Some programs in JAVA from school lesson