Reference no: EM132409040
Topic: Switch-Case statements
The following 5 questions are taken from the previous exercise on Methods where you created methods for each of the tasks.
Write a method called odd to work out the sum of the first n odd numbers
Write a method called even that will add the first n even numbers.
Write a method called smallest that prompts the user to print out the smallest of three given numbers
Write a method called squares that will work out the sum of the squares for the first n numbers.
Example
12 + 22 + 32 + 42 + etc.
Write a method called cubes that will display the 1, 8, 27, 64, ... up to n and work out the sum for the first n cube numbers
1. Create a class called Menu with a main method
Use switch and case statements to develop a menu driven program that will allow the end user to select options for invoking methods for each of the above problems (1 to 5).
An outline of the Menu class is given below to guide you!
![1394_Code.jpg](https://secure.expertsmind.com/CMSImages/1394_Code.jpg)
Challenge
2. Create a class called Menu2 with a main method
Use switch and case statements to develop a menu driven program that will allow the end user to select options for invoking methods from the UserInformation and BMI classes created previously.