In C++
Design a program for a coffee shop. Make a menu driven program that allows the user to select items from a menu and add them to an order. Once the user is satisfied with their order, they can output a sales receipt. Display the receipt on the console and save the receipt in a txt file: qbc_sales_receipt.txt. . This coffee shop menu includes
Coffee 1.85
Tea 1.05
Milk 1.25
Donut 2.25
Bagel 2.75
After each item is added to order, display a message for the user indicating the item name and total price (so 2 items at 2.50 each display 5.00)
The program ends when the user prints their sales receipt
The sales receipt should contain:
-Line item for grand total
-Line item for sales tax which is 8%
-Line items with quantity, item name, and item price total
If nothing is ordered, display “No receipt required. Thanks!”
Modular Functions Requirement: main, displayMenu, displaySalesReceipt
Input validation required
The final display should read something like this
Would you like to place an order? (y/n): y
ITEM Price
********************
1. Coffee 1.85
2. Tea 1.05
3. Milk 1.25
4. Donut 2.25
5. Bagel 2.75
********************
Please make a selection: 2
How many Tea would you like: 4
4 of Tea added to order for 4.2
Would you like to continue ordering? (y/n): y
ITEM Price
********************
1. Coffee 1.85
2. Tea 1.05
3. Milk 1.25
4. Donut 2.25
5. Bagel 2.75
********************
Please make a selection: 1
How many Coffee would you like: 3
3 of Coffee added to order for 5.55
Would you like to continue ordering? (y/n): n
SALES RECEIPT
********************
4 Tea $4.2
3 Coffee $5.55
********************
Subtotal: $9.75
Tax Total: $0.78
********************
Total: $10.53
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images
How to turn this code that it accepts string input for the choice of drink instead of using int?
How to turn this code that it accepts string input for the choice of drink instead of using int?
- JAVA PPROGRAM ASAP Hypergrade does not like this program because it says 2 out of 7 passed and take out the extra \n from the program. Please Modify and change this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases. The program must pass the test case when uploaded to Hypergrade. Also, for test cases 1-4 it wants only to input Please enter the file name or type QUIT to exit: then input the file and display the Total number of words. For test cases 5 and 7 it wants to only to input Please enter the file name or type QUIT to exit then input input5.txt and then display File: input5.txt does not exist.\n then display Please enter the file name again or type QUIT to exit:\n then type input1.txt to display the total number of words or type quit to exit the program. For test case 6 it wants only to Please enter the file name again or type QUIT to exit:\n then type quit to exit the porgram. import java.io.File;import java.io.FileNotFoundException;import…arrow_forwardIn C++, use a void() and switch case for the command menu to delete a specific line from the textfile icecream.txt. CONSOLE command:delete cout<<"What icecream do you want to delete from the text file?"; cin >> chocolate; cout <<"deleted"; Chocolate is now removed/deleted from the text file. icecream.txt chocolate $15 vanilla $12 strawberry $8arrow_forwardIN JAVA Description A teacher has five students who have taken four tests. The teacher uses the following grading scale to assign a letter grade to a student, based on the average of his or her four test scores. Test Score Letter Grade 90-100 A 80-89 B 70-79 C 60-69 D 0-59 F The student and score data are stored in the given file StudentInfo.txt. Create a class named GradeBook in a file named GradeBook.java. The class GradeBook is required to use a String array to hold the five students’ names, an array of five characters to hold the five students’ letter grades, and five arrays of four doubles each to hold each student’s set of test scores. The class should have methods that return a specific student’s name, average test score, and a letter grade based on the average. The program that demonstrates the class GradeBook is given in the file GradeBookDemo.java. You are required to read and understand the given program, and make the program…arrow_forward
- >> classicVinyls.cpp For the following program, you will use the text file called “vinyls.txt” attached to this assignment. The file stores information about a collection of classic vinyls. The records in the file are like the ones on the following sample: Led_Zeppelin Led_Zeppelin 1969 1000.00 The_Prettiest_Star David_Bowie 1973 2000.00 Speedway Elvis_Presley 1968 5000.00 Spirit_in_the_Night Bruce_Springsteen 1973 5000.00 … Write a declaration for a structure named vinylRec that is to be used to store the records for the classic collection system. The fields in the record should include a title (string), an artist (string), the yearReleased (int), and an estimatedPrice(double). Create the following…arrow_forwardIN C++ Write a program that represents a playlist on a video streaming service. Each video has a title and total minutes. The user should be able to do the following with the playlist: Add video to list Remove video from list Display list in alphabetical order by title Exit playlist Your driver file will need a storage object that can handle any amount of videos. You will also need to provide a menu that shows and performs the various options above. The menu should continue to display until the user selects the "Exit playlist" option. A description of each menu option is listed below: Add video to list Prompts the user for a video title and total minutes Then your code stores the video onto the storage object of your choice Remove video from list Prompts the user for a video title Then your code removes that video from your storage object Display list in alphabetical order Displays the video's title and total minutes for each video in your storage object. Sample format:…arrow_forwardin java but don't write as a GUI (Graphical User Interface) Write a program that reads a file named input.txt and writes a file that contains the same contents, but is named output.txt. The input file will contain more than one line when I test this and so should your output file. Do not use a path name when opening these files. This means the files should be located in the top level folder of the project. This would be the folder that contains the src folder, probably named FileCopy depending on what name you gave the project. Do not use a copy method that is supplied by Java. Your program must read the file line by line and write the file itself. Class should be named FileCopy do not write to input.txt!arrow_forward
- The file Names.txt is located in the folder input_files within your project. The content of that file is shown in the following figure Java: import java.io.FileInputStream;import java.io.FileNotFoundException;import java.util.ArrayList;import java.util.Scanner;public class Question2 {public static void main(String[] args) throws FileNotFoundException {/*** Part a* Finish creating an ArrayList called NameList that stores the names in the file Names.txt.*/ArrayList<String> NameList;/*** Part b* Replace null on the right-hand-side of the declaration of the FileInputStream object named inputStream* so that it is initialized correctly to the Names.txt file located in the folder specified in the question description*/FileInputStream inputStream = null;Scanner scnr = new Scanner(inputStream); //Do not modify this line of code/*** Part c* Using a loop and the Scanner object provided, read the names from Names.txt* and store them in NameList created in Part a.*//*** Part d* Reorder the…arrow_forwardIn C++, using STL algorithms create a program that allows the user to search the text file for a price, and return all items for the inputted price. Console: Enter the command: cin>> search What price do you want to search for? cin>> $10 cout << "The following flavors are $10 " << flavor << flavor << endl; --------------------------------------------------------------------- Strawberry and rainbow should be returned for $10 If no flavor is $10: cout<<"Sorry, that price is not available"; Provided text file: icecream.txt chocolate $15 strawberry $10 vanilla $13 rainbow $10arrow_forwardDesign a program that reads a file called sales.txt containing the following data: Jane, 215.5,445.5,910.0 John, 825.0,250.5,675.0 Bill,0.0,999.15 Each line has a employee's name and their weekly sales totals all separated by commas. Some employees have taken vacation some weeks so no numbers are captured for those weeks. Create a function that takes a list of floats and returns the average value for those numbers. After reading the information from the file, use a for loop to calculate the sales average using your new average function for each employee and display the following output to the screen. Jane, average sales: 523.67 John, average sales: 583.50 Bill, average sales: 499.56arrow_forward
- A word Decrambling game using srand() for descrambling these words: "Screen, Programming, Command, Definition." The game should be timed for 1 minute or 30 seconds using the <ctime> library. Should allow for user input to be able to guess...arrow_forwardin java #6 - program that reads the name data from the files named firstNames.txt and lastNames.txtand produces a list of 1000 random names randomPeople.txtone complete name (firstname lastname) per linearrow_forwardPLEASE DONT COPY OFF OTHER POSTS CODE help with java..plzz paste indented code add comments tooarrow_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