Solution code of class exercise Q1
Completion requirements
Click Main.java link to view the file.