Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
Transcribed Image Text:Example Program Execution
Example output
Calculator Menu
Hello Ashley Long
1) Wage Calculator
Your regular hours worked are 40. Your overtime ho
| 2) Coupon Calculator
urs worked are 4.
Your regular pay: 3,048ドル.00
Your overtime pay: 457ドル.20
3) Exit
Please enter your choice: 1
Please enter your name: Ashley Long
Your total pay: 3,505ドル.20
Please enter your hourly wage: 76.20
Thank you for using the Wage Calculator Ashley!
Please enter your hours worked: 44
Have a great day!
Calculator Menu
1) Wage Calculator
2) Coupon Calculator
3) Exit
Please enter your choice: 2
Please enter your purchase amount $: 100.00
Please enter purchase type (1=Auto Parts, 2=Fragrances, 3=Accessories): 1
Your coupon amount is 10ドル.00 (Auto Parts).
Thank you for using the Coupon Calculator!
Have a great day!
Calculator Menu
1) Wage Calculator
2) Coupon Calculator
3) Exit
This program will now end.
Please enter your choice: 3
Thank you for using our program!
Transcribed Image Text: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)
Coupon Calculator, and 3) Exit. Class Name: PartA
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 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]
Coupon Calculator: For the coupon calculator, the total coupon amount is calculated based on
the type of items purchased. Ask for the shopper's total purchase amount. Then show the
following options to determine coupon amount: 1=Auto Parts, 2=Fragrances, 3=Accessories. If
the choice is 1, calculate a 10 percent coupon. If the choice is 2, calculate a 15 percent coupon. If
the choice is 3, calculate a 20 percent coupon. Print the choice and coupon amount in dollars and
cents. [Format: "Your coupon is 10ドル.00 (Auto Parts) "]
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/NO on-the-fly declarations) and commenting (correct header with well-formed
pseudocode). To obtain 50 of 100 points, your program must compile and begin execution. 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. Your program should NOT loop on the menu (we will
execute the program for each option).
Once complete, you will submit your java file using the ProjectPartA link in Moodle. See the
next page for an example program execution.
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Background pattern image
Similar questions
- Parking Charges Program in java Write a program that works out the amount a person has to pay for parking in a car park in a tourist town. If they say they are disabled, they are told it is free. Otherwise they enter the number of hours as a whole number (1-8) that they wish to park as well as whether they have an "I live locally" badge or are an old age pensioner both of which leads to a discount. The program tells them the cost to park. The calculation is done in this program as follows. If they are disabled it is free. Otherwise ... Take number of hours they wish to park and give a basic charge: • • • • 1 hour: 3.00 pounds 2-4 hours: 4.00 pounds 5-6 hours: 4.50 pounds 7-8 hours: 5.50 pounds Next modify the resulting charge based on whether they are local or not: • If local: subtract 1 pound If OAP: subtract 2 poundsYour program MUST include methods including ones that - asks for the hours and returns the basic charge. - asks whether they live locally /...arrow_forwardASSIGNMENT: You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. The price per board foot is given in the following table: Pine 0.89 Fir 1.09 Cedar 2.26 Maple 4.50 Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T,...arrow_forwardIn Java Menu-Driven System Part AWrite a menu-driven program that will give the user the three choices: 1) Wage calculator, 2)Coupon Calculator, and 3) Exit. Class Name: PartAWage Calculator: For the wage calculator, prompt for the name and hourly pay rate of anemployee. Here the hourly pay rate is a floating-point number, such as 9ドル.25. Then ask howmany hours the employee worked in the past week. Be sure to accept fractional hours. Computethe 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 (donot show overtime pay if there is none), and total pay. [Do not prompt for overtime hours]Coupon Calculator: For the coupon calculator, the total coupon amount is calculated based onthe type of items purchased. Ask for the shopper’s total purchase amount. Then show...arrow_forward
- def area(side1, side2): return side1 * side2s1 = 12s2 = 6Identify the statements that correctly call the area function. Select ALL that apply. Question options: area(s1,s2) answer = area(s1,s2) print(f'The area is {area(s1,s2)}') result = area(side1,side2)arrow_forwardObject-Oriented Programming ❤❤❤ Matchmaker with Java ❤❤❤ Summary: Create a Java application that will determine your true love. Prerequisites: Java, VS Code, and Terminal In this assignment you will develop and test a command-line application written in the Java language that asks questions to determine if a person is your true love. More specifically your application should ask five questions in the form of statements and allow the user to respond to each statement with the numbers 1 through 5 with 1 indicating strongly disagree and 5 indicating strongly agree. You will then compare the person’s answers with your desired "true love" answers. The closer the answers are to your desired "true love" answers the better match the two of you are for each other. For example, suppose you choose the statement "Broccoli is delicious." and your desired answer was 1 (strongly disagree) because you really don’t like broccoli. If the application user entered 4 (agree), then the two of you would not...arrow_forwardDon't use AI.arrow_forward
- Question #1: Treadmill burned calories Java ProgramA treadmill workout machine provides the following activities: running, walking, and mountainclimbers. The machine uses metabolic equivalents (MET) to measure the amount of energy thatis expended during exercise.Here are the machine different activities and their METS:Running 6 MPH: 10 METSWalking 3 MPH: 4 METSMountain Climbers 3 MPH: 8 METSThe number of calories burned per minute may be estimated using the formula:Energy expenditure (Calories/ Minute) = 0.0175 ×ばつ MET ×ばつ Weight (in kilograms).In this question, ywrite a Java program, which:1. Display a welcome message.2. Prompts the user to enter the weight in pounds.3. Prompts the user to enter the running, walking and mountain climbers’ timesrespectively.4. calculates and outputs the calories burned for each activity as well as the total number ofcalories burned.5. Display a farewell message, so that the user knows that the program has terminatednormally, example: Keep up your hard...arrow_forwardC++ language pleasearrow_forwardJava question Write a program that plays the Rock-Paper-Scissors game againstthe computer. When played between two people, each personpicks one of three options (usually shown by a hand gesture) atthe same time, and a winner is determined. In the game, Rockbeats Scissors, Scissors beats Paper, and Paper beats Rock. The program should randomly choose one of the three options (with-out revealing it), then prompt for the user's selection. At that point, the program reveals both choices and prints a statementindicating if the user won, the computer won, or if it was a tie.Continue playing until the user chooses to stop, then print thenumber of user wins, losses, and ties.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Text book imageComputer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONText book imageComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceText book imageNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Text book imageConcepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningText book imagePrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationText book imageSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY