Question

Using C++ Mr. Manager wants you to process orders for the Fast Greasy Food Shop. His...

Using C++

Mr. Manager wants you to process orders for the Fast Greasy Food Shop. His customers have a few choices in what they order. The can order a hamburger for 1.00. It they want cheese it is an addition .50 and if they want bacon the additional amount is .75. They can also order a small or large drink for 1.10 and 1.60 respectively and small or large French fries for 1.20 or 1.75 respectively.    The user can only order one hamburger/drink/fries. Write a program which allows a customer to purchase any or all of the items above.

Your program should print out the total price of the purchase as well as the price of each individual item as in the example below. Be sure to only print the items that the user ordered. For instance, if they do not order a drink, do not give the price for a drink. Ask a series of Yes/No questions where the user will respond with y or n for their meal choices.

Hamburger                         1.00

Cheese                                 .50

Large Fries                          1.75

Small Drink                          1.10

Total                                      4.35

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

#include<iostream.h>
#include<conio.h>
void main()
{
char hamburger,cheese,bacon,smalldrink,largedrink,smallfries,largefries,t;
double amt;
clrscr();
cout<<"Do you Want Hamburger Y/N?";
cin>>hamburger;
cout<<"Do you Want to add Chees ont it Y/N?";
cin>>cheese;
cout<<"Do you Want to add Bacon ont it Y/N?";
cin>>bacon;
cout<<"Do you Want Drink Y/N?";
cin>>t;
if(t=='y' || t=='Y')
   {
   cout<<"Small Drink";
       cin>>smalldrink;
   cout<<"Large Drink";
       cin>>largedrink;
   }
cout<<"Do you Want French Fries Y/N?";
cin>>t;
if(t=='y' || t=='Y')
   {
   cout<<"Small French Fries";
       cin>>smallfries;

   cout<<"Large French Fries";
       cin>>largefries;
   }
if(hamburger='y' || 'Y')
{
   amt=1;
       cout<<"Hamburger\t1.00"<<endl;
}
if(cheese='y'||'Y')
{
   amt+=.5;
       cout<<"Cheese\t .50"<<endl;
}
if(bacon='y' || 'Y')
{
   amt+=.75;
       cout<<"Bacon \t .75"<<endl;
}
if(smalldrink='y' || 'Y')
{
   amt+=1.10;
       cout<<"Small Drink\t1.10"<<endl;
}
if(largedrink='y' || 'Y')
{
   amt+=1.60;
       cout<<"Large Drink\t1.60"<<endl;
}
if(smallfries='y' || 'Y')
{
   amt+=1.20;
       cout<<"Small French\t1.20"<<endl;
}
if(largefries='y' || 'Y')
{
   amt+=1.75;
       cout<<"Large Drink\t1.75"<<endl;
}
cout<<"Total \t"<<amt;
getch();
}

o you Want HamburgerY/N?y o you Want to add Chees ont it Y/N?y o you Want to add Bacon ont it Y/N?y o you Want Drink Y/N?uy m

Add a comment
Know the answer?
Add Answer to:
Using C++ Mr. Manager wants you to process orders for the Fast Greasy Food Shop. His...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 2: Point of Sale System The McDowell Restaurant chain has asked you to write a...

    Problem 2: Point of Sale System The McDowell Restaurant chain has asked you to write a menu program for their new Fast-food service machines. Your program already prints the following menu like this: ********************************************************************** McDowell’s Restaurant ********************************************************************** Make your selection from the menu below: 1. Regular Hamburger $1.50 2. Regular Cheeseburger $1.75 3. Fish Sandwich $2.50 4. Half-pounder with cheese $2.75 5. French Fries $0.99 6. Large Soft Drink $1.25 *********************************************************************** Select 1, 2, 3, 4, 5, or 6 -----...

  • Using C#, write a program. You are a coffee and tea shop. You will allow customers...

    Using C#, write a program. You are a coffee and tea shop. You will allow customers to enter their orders. You sell coffee and tea in three sizes, small coffee for $1.00, medium for $1.20, and large for $1.40. Tea is $1.20, $1.40, and $1.60. You will let ask the user what they want, size, ask if they want to order anything else, continue taking their order. At the end show them how much they owe. If they order more...

  • Order up:: Write a program that will be used to keep track of orders placed at...

    Order up:: Write a program that will be used to keep track of orders placed at a donut shop. There are two types of items that can be ordered: coffee or donuts. Your program will have a class for each order type, and an abstract superclass. Coffee orders are constructed with the following information: quantity (int) - how many coffees are being ordered size (String) - the size of the coffees (all coffees in the order have the same size)...

  • Write a program in C++ that simulates a soft drink machine. The program will need several...

    Write a program in C++ that simulates a soft drink machine. The program will need several classes: DrinkItem, DrinkMachine and Receipt. For each of the classes you must create the constructors and member functions required below. You can, optionally, add additional private member functions that can be used for doing implementation work within the class. DrinkItem class The DrinkItem class will contains the following private data members: name: Drink name (type of drink – read in from a file). Type...

  • I can't figure this one out at all. Any help would be appreciated. Here's the question:...

    I can't figure this one out at all. Any help would be appreciated. Here's the question: You will need to complete the functions to Toggle the Fries and Drinks sections by adding or removing the 'hide' CSS class I created. I have already created the function to Toggle Burgers and you can use that as an example to build out the full functionality. I have also made created the function to reset the form. Finally, to calculate the total, you...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

  • SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the...

    SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT