Question
Write a menu-driven program that will give the user the three choices: 1) Wage calculator, 2) Tip Calculator, and 3) Exit. Class Name: Party Password
Write a menu-driven program that will give the user the three choices: 1) Wage calculator, 2) Tip Calculator, and 3) Exit. Class Name: Party Password Access: For the user to gain access to the menu, they must enter a pin number (use pin 9999 for this first program). You will prompt the user for the pin number. If the pin is correct, then display the menu. If the pin is incorrect, end the program with a message "Thank you for using our menu system." Wage Calculator: For the wage calculator, prompt for the name and hourly pay rate of an employee. Here the hourly pay rate is a floating-point number, such as S9.25. Then ask how many hours the employee worked in the past week. Be sure to accept fractional hours. Compute the pay. Any overtime work (over 40 hours per week) is paid at 150 percent of the regular wage (1.5 the hourly pay rate). Print the employee's name, regular hours worked, regular hours pay, overtime hours worked (do not show overtime hours, if there are none), overtime hours pay (do not show overtime pay if there is none), and total pay. [Do not prompt for overtime hours] Tip Calculator: For the tip calculator, the tip is calculated based on the diner's satisfaction level. Ask for the diner's satisfaction level using these ratings: 1=Totally satisfied, 2=Satisfied, 3=Dissatisfied. If the diner's choice is 1, calculate a 20 percent tip. If the diner's choice is 2, calculate a 15 percent tip. If the diner's choice is 3, calculate a 10 percent tip. Print the satisfaction level and tip in dollars and cents. [Format: "Your tip is S4.00 (Totally satisfied)"] Exit: The exit choice will display a statement that the program will end and thank the user for using the program. [They must choose to exit the menu, not default out ? it is a menu option] Your program should be complete and with correct convention (i.e. Variable naming and declaration) and commenting (correct header with well-formed pseudocode). The obtain 50 of 100 points, your program must compile and run. You will obtain 30 points if your program runs correctly. You will obtain 20 points for all other convention and commenting (this includes file and class naming convention). All output should be properly formatted and user friendly.
Step by Step Solution
3.40 Rating (150 Votes )
There are 3 Steps involved in it
Step: 1
CODE import javautilScanner public class PartA public static void mainString args Scanner sc new ScannerSystemin validatePasswordsc int choice boolean ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started