Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write a java program that displays a Café menu from which a user can place an order. The program begins by showing the menu and promoting the user to enter a choice. If the user enters 1, 2, 3, 4, or 5, the program responds by asking the quantity of order. If the user enters a number outside the range 1 -5, the program prints an error message, then ask the user to enter a new choice. The program “loops” until the user select 0 to exit the menu. Finally, the program displays a summary of the user’s order. Your program output should resemble the sample runs as following.
Welcome to our Cafe!
Please select
Enter 1 for Americano - 4 $
Enter 2 for Cappuccino - 4.5 $
Enter 3 for Latte -4.75 $
Enter 4 for Mocha - 4.35$
Enter 5 for Tea - 3.50$
Enter 0 when you are done
New Choice: 1
How many would you like ?
Quantity: 2
New Choice: 2
How many would you like ?
Quantity: 1
New Choice: 0
Proceeding to check-out.
Your total is: 12.5
Thank you. Have a nice day.
Welcome to our Cafe!
Please select
Enter 1 for Americano - 4 $
Enter 2 for Cappuccino - 4.5 $
Enter 3 for Latte -4.75 $
Enter 4 for Mocha - 4.35$
Enter 5 for Tea - 3.50$
Enter 0 when you are done
New Choice: 7
You have entered a choice that is not
on the menu.
Please try again
New Choice: 1
How many would you like ?
Quantity: 2
New Choice: 0
Proceeding to check-out.
Your total is: 8.0
Thank you. Have a nice day.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 3 images
Knowledge Booster
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
- Write a program that generates a random number in the range of 1 through 1000, and asks the user to guess what the number is. If the user guess is higher than the random number, the program should display Too high, try again. If the users guess is lower than the random number, the program should display Too low, try again. If the user guesses the number, the application should congratulate the user and generate a new random number so the game can start over. If the user doesn't want to continue the game the user should type an appropriate stop symbol to terminate the program (such stop conditions were discussed in the class). For each game iteration, count the number of guesses made by the user and display them. The program should contain the following functions: check_guess(): this function checks if the user's guess is lower, higher or equal to the random number. random_gen(): function that generates one random number for one game iteration main(): the function where the program…arrow_forwardWrite a program to ask the user to enter "how many quizzes?" he/she has entered in a lecture. The program will ask the grade results of the number of quizzes entered. The program will show the quiz results and the average of the quizzes as an output. As an extra challenge, display the maximum quiz result as well. How many quizzes?6 Enter the grade of Enter the grade of Enter the grade of Enter the grade of Enter the grade of quiz 5 : 30 Enter the grade of quiz 6: 12 Avarage of quizzes: 49 Maximum of quizzes: 95 quiz 1: 30 quiz 2 : 95 quiz 3 : 88 quiz 4 : 52arrow_forwardCSCI 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…arrow_forward
- P7arrow_forwardIn Coral Language 3.22 LAB: Loops: Countdown until matching digits Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 Ex: If the input is: 77 the output is: 77 Ex: If the input is: 9 or any number not between 20 and 98 (inclusive), the output is: Input must be 20-98 For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, …, 88), as that approach would be cumbersome for large ranges.arrow_forwardJava Programming A bakery company provides a bonus of a new bakery product package for customers who buy at least 10 breads in the company anniversary award which will be celebrated in the next three months. To get the bonus, the customer is given the opportunity three times to guess a number determined by the application from numbers 1 to 20. For each guess number given by the customer, the application will respond as follows:• If the guessed number is smaller than the lucky number, you will see the words "Bigger Number"• If the guessed number is greater than the lucky number, you will see the words "Smaller Number"• If the guessed number is the same as a lucky number, it will match the words "Congratulations ... you found a LUCKY number"As part of the company's IT team, you serve to create a lucky number guessing game console.A. Determine the inputs and outputs of the design programb. Draw a Flowchart of the programc. Write Coding to make the applicationd. Give Screen shoot the…arrow_forward
- in Java languagearrow_forwardWrite a javascript program that calculates how much a person would earn over a period of time. if his or her salary is one dollar the first day and two dollars the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing how much the salary was for each day, and then show the total pay at the end of the period. Input Validation: Do not accept a number less than 1 for the number of days worked.arrow_forwardA program is needed to manage sales of Super Bowl souvenir t-shirts. There are three types of shirts that we are selling: Chiefs t-shirts Eagles t-shirts Super Bowl t-shirts The t-shirts are all priced at $40 each without any customization. Input: Your program is to display a menu listing each type of shirt. It should then prompt the user for the number of Chiefs t-shirts they would like to order. After the number of Chiefs t-shirts has been entered (which may be 0), if the number was greater than 0, we will ask if they need to add lettering to the shirt (costs 1 dollar per printed letter) the program should continue displaying a prompt and reading the number to order for the other two types of t-shirts in the same way. The program also needs to keep track of the customer name and mailing address. Prompt and read the customer’s name, street address, city, state, and zip code.arrow_forward
- Develop a program that allows the user to enter a start value of 1 to 4, a stop value of 5 to 12 and a multiplier of 2 to 8. The program must display a multiplication table with results using these values. For example, if the user enters a start value of 3, a stop value of 7 and a multiplier value of 3, the table should be displayed as follows: Multiplication Table 3 x 3 = 9 3 x 4 = 12 3 x 5 = 15 3 x 6 = 18 3 x 7 = 21 additionally Each multiplication problem must be displayed with a problem number. The program must prompt the user to enter an answer to each of the multiplication problems. The correct answer should be displayed after the user enters an answer. A message should be displayed informing the user that the answer entered was correct or incorrect followed by an appropriate motivating comment. A running record of the number of correct and incorrect responses must be kept. After all the problems have been presented the user must be informed of his/her performance; number of…arrow_forwardThe game should begin by randomly dealing 2 cards to the user's hand, and then calculate and display the total. Next the program should display a prompt, asking the user if he/she wants a Hit or to Stand. If the user selects to Hit the game should randomly deal a new card to the user's hand, and then calculate and display the new total. If the total is greater than 21, then the user Busts, the house wins, and a message indicating these results is displayed. If the total is less than 21, repeat the Hit/Stand Prompt to the user. Continue this process until the user elects to Stand or Busts. If the user selects to Stand, the game then randomly deals two cards to the house, and then calculates those total points. The dealer must continue to Hit as long as the total of the House had is under 17, display the results after each Hit The dealer must Stand once the House hand reaches 17 or higher. Once If the user has not already Busted, compare the User's Hand to the House Hand and determine…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education