Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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
Check Mark
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. 

 

 

Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education