achieve the part ofthe pascal java