Question: CSCI 140/L Java Project: Menu-Driven System Part A Write a menu-driven program that will give the user the three choices: 1) Wage calculator, 2) Tip
CSCI 140/L Java Project: Menu-Driven System Part A Write a menu-driven program that will give the user the three choices: 1) Wage calculator, 2) Tip Calculator, and 3) Exit. Class Name: PartA 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 $9.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 employees 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 diners satisfaction level. Ask for the diners satisfaction level using these ratings: 1=Totally satisfied, 2=Satisfied, 3=Dissatisfied. If the diners choice is 1, calculate a 20 percent tip. If the diners choice is 2, calculate a 15 percent tip. If the diners choice is 3, calculate a 10 percent tip. Print the satisfaction level and tip in dollars and cents. [Format: Your tip is $4.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 (ie. 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. Once complete, you will submit your .java file using the ProjectPartA link in Moodle. See the next page for an example program execution. Example Program Execution Example output Please enter pin number: 9999 Calculator Menu 1) Wage Calculator 2) Tip Calculator 3) Exit Please enter your choice: 1 Please enter your name: Ashley Long Please enter your hourly wage: 76.20 Please enter your hours worked: 44 Hello Ashley Long Your regular hours worked are 40. Your overtime hours worked are 4. Your regular pay: $3,048.00 Your overtime pay: $457.20 Your total pay: $3,505.20 Thank you for using the Wage Calculator Ashley! Have a great day! Calculator Menu 1) Wage Calculator 2) Tip Calculator 3) Exit Please enter your choice: 2 Please enter satisfaction Level (1=Totally Satisfied, 2=Satisfied, 3=Dissatisfied): 1 Please enter your dinner total: 20.00 Your tip amount is $4.00 (Totally Satisfied). Thank you for using the Tip Calculator! Have a great day!
I know this question has been asked before and I am just asking for one thats more clear to me. This is my first programming class and I need an example thats at a lower level of programming
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
