I am still very much a beginner in programming and am facing a problem with a Java code. I would be very thankful for suggestions and comments. The problem is as following:

I found a Java code...