Home work for my Java course. Remade for math logic course home work.