
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 stepSolved in 3 steps with 1 images

- Each function inside the class A(n)_ is a virtual function. Provide your thoughts by filling in the blanks.arrow_forwardIn C++ create a program that acts like a bank account. It asks the user whether to deposit or withdraw. That has 3 classes. The first class must be a generic class that holds basic info deposit, withdraw, calculate monthly interest rate, and a monthly service fee.The second class must be a savings account class that if the savings account falls below $25 it becomes inactive. The final class must be a checking account if someone withdraws more than what they have a service charge of $15 is added and go into a negative balance. The output should display the basic information how much someone deposited or withdrew and their monthly interest rate.arrow_forwardCreate a UML Diagram of a class named Investment with fields called principal and interest. It also contains methods named value_after that returns the value of the investment after n years. The formula for this is p(1+i)ⁿ, where p is the principal, and i is the interest rate.arrow_forward
- Implement the following parking permit class using java It has a dependency on the car class, no need to implement the car class. Use the diagram for refrencearrow_forwardPlease do not give solution in image format thankuarrow_forwardClass Connect6State Cloneable Connect6State - A representation of a Connect6 game state. We assume a square grid board size specified to be a positive integer less than or equal to 26. Size 19 is common. The first and second players place pieces on the board that are black and white, respectively. Each piece is placed in an unoccupied grid position. On the first turn, the first player places one piece. Afterwards, players alternate placing two pieces per turn. Play continues until either one player completes a consecutive line of 6 or more of their pieces or no play is possible. The player with 6 or more pieces in a horizontal, vertical, or diagonal line is the winner. If no legal play is possible, the game is a draw Field Detail BLACK public static final int BLACK a constant indicating a black player/piece See Also:Constant Field Values WHITE public static final int WHITE a constant indicating a white player/piece See Also:Constant Field Values NONE public static final…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





