java-write a program using overloading concept create a class to find out and show the area and perimeter of shape chose by the user. The user must be provided with a menu to chose her.his option. she/he should be asked to input the corresponding and necessary information. The menu must repeaditly be shown to the user till he decided to exit the progra
in java-write a
Program Approach:
1- The concept of method overloading means the same method name and different types of arguments.
2- As mentioned in the assignment create the menu program, it will repeat again n again till the user will not enter the exit number.
3- With the help of the do-while loop used to create the menu program.
4- Created method name as calculate() with different arguments. That is part of method overloading.
5- The scanner class is used to take input from a user.
6- Prompt a message to take the area or perimeter input from a user.
7- Mentioned method return the type as void with the static keyword.
8- For static keywords don't need to create the object of a class to call the method.
9- Static keyword belongs to the class area, the user can call directly.
10- Please check the following complete example and output screenshot.
Step by step
Solved in 3 steps with 1 images