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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

in 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 program

Expert Solution
Step 1

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. 

 

 

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education