Can someone help me solve this problem in Java?

image
image
these are the questions, below is the boilerplate.
image

Comments (0)