Note that where solutions are given, they will include supporting
code
which will allow you to test the method. Please note that under
examination
conditions, if you are asked to write a method to do something you
should
write just that method (and possibly auxiliary methods which
you
define yourself to make it work), and not the supporting code. No
exam question will ask or expect you to write the main
method which starts off execution of a Java program, or code to prompt
a human user to type anything or code to display any results to a human
user.