Local diner that allows customers to see the diner''s menu

Assignment Help C/C++ Programming
Reference no: EM13165346

Design a program to be used for a small local diner that allows customers to

see the diner's menu and then make their meal selections using the program.

The program will also calculate and print an itemized bill.

Define a record (struct), menuItemType, with two components: menuItem of type

string and menuPrice of type double. Use an array, menuList, of the struct

menuItemType so that you just need to print the array to print the entire menu.

The program should do the following:

Show the customer the different breakfast items offered by the restaurant.
Allow the customer to select more than one item from the menu.
Assign the customer a number from 0 to 99.
Calculate and print the bill with the customer number.
Save the customer's selections and amount due in an array of records using their

customer number as the index. Assuming that the diner will never have more than

100 customers at one time, the program can cycle back to index 0 when it reaches

the end of the array at index 99.
Clear the screen for the next customer.


Although your team may decide to add items, assume that at the minimum the diner

offers the following breakfast items (the price of each item is shown to the right of the item):
Two Scrambled Eggs .................................. $2.25
Bacon, Egg, and Cheese on a Hard Roll ....... $3.25
Corn Muffin .............................................. $1.49
French Toast Plate ..................................... $3.99
Fruit Plate ................................................. $3.49
Cereal and Milk ......................................... $1.49
Coffee ...................................................... $1.50
Tea ........................................................... $1.00

Your program must contain at least the following functions:

Function getData: This function allows the restaurant owner to load the data

into the array menuList. Should provide a facility for the owner to change menu

items and prices.
Function showMenu: This function shows the different items offered by the

restaurant and tells the user how to select the items.
Function printCheck: This function calculates and prints the check.

(Note that the billing amount should include a 8.125% tax.)

A sample output could be:

Welcome to DCC Diner!
Your Customer Order Number is 34
1 Bacon, Egg, and Cheese on a Hard Roll ........... $3.25
2 Corn Muffin .................................................. $2.98
1 Coffee .......................................................... $1.50
Total ............................................................... $7.73
Tax ................................................................. $0.63
Amount Due ................................................... $8.36

Format your output with two decimal places. The name of each item

in the output must be left justified.

-----------------------------------------------------------------------------------

 

int main()
{
   double menuItem[row][col];
   double itemPrice[row][col];

   getData(menuItem);
   showMenu();


return 0;
}

//*******************************************
void getData(double menuList[row][col])
{
   ifstream infile;
   int x;
   int y;
   string item;
   double price;

infile.open("Menu.txt");
  
   for (x=0; x<12; x++)
   {
       for (y=0;y<2;y++)
       {
       getline(infile, menu[x].menuItem);
   item = menu[x].menuItem;
     
infile >> menu[x].itemPrice;
   price = menu[x].itemPrice;

       cout << left << item << setw(15) << setfill('.') << setprecision(2) << right;
   }
   }

   infile.close();
}

//************************************************
void showMenu()
{
   int x;
   int y;

   for (x=0; x<24; x++)
   {
       for (y=0; y<1; y++)
       {
       cout << left << theMenu[x].menuItem << setw(20) << right << theMenu[y].itemPrice << endl;
   }
}

}
//************************************************************

 

Reference no: EM13165346

Questions Cloud

What is the volume of water in the tub, in liters : A hot tub is filled with 480 gallons of water, which has a density of 1.0 {rm g/mL}. What is the volume of water in the tub, in liters?
Business of designing and manufacturing helicopters : Since the VP's trust you, they asked you to figure out the most they should pay for a license from SohnCo and yuli-One Copters is known to be aggressive in ignoring intellectual property claims.
Analyze the benefits and drawbacks of the common criteria : "'Recall that criteria creep' is the process of refining evaluation requirements as the industry gains experience with them, making the evaluation criteria something of a moving target. (See Section 21.2.4.2.)
Validity-reliability and accuracy : Validity, Reliability, and Accuracy Select one of the learning outcomes below and draft a hypothetical assessment that supports the outcome (e.g., multiple choice items, essay items, authentic assessment, etc.).
Local diner that allows customers to see the diner''s menu : Design a program to be used for a small local diner that allows customers to see the diner's menu and then make their meal selections using the program.The program will also calculate and print an itemized bill.
Find the enthalpy of formation for c6h12o6 : Given that the enthalpy of formation is -277.7 kJ/mol for C2H5OH(l) and -393.5 kJ/mol for CO2(g), find the enthalpy of formation for C6H12O6.
Using sequential logic, counters and shift registers propose : using sequential logic, counters and shift registers propose a more complex system utilizing some of the more complex sub systems. example a motion acitavated light. Needs to be somthing other then a light example like motors or somthing
Compute janice morgan of federal income tax payable : Janice has interest income of $5,000 on certificates of deposit at Second Bank. Janice makes estimated tax payments of $17,000 for 2011.
What would be the volume of a gram sample of chlorine gas : Chlorine gas is known to have a density of 3.17 g/L at standard temperature and pressure. What would be the volume of a 4.6 gram sample of chlorine gas at standard temperature and pressure?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Why does the neverwet spray protect it from water

As is know, acetone is a polar molecule like water, so isn't it suppose to mix? So my question is: why does the Neverwet spray protect it from water but not from oils and detergents?

  Three or more dimensions

What kind of program, or problem, might necessitate arrays of three or more dimensions?

  Write a program in c that will find smallest value

Write a programe c that will find the smallest, largest and average values in a collection of N numbers.Get the value of N before scanning each value in the collection of N numbers.

  Write a program to read only one integer number

Write a program to read ONLY one integer number (your input must be one 3 digit number from 100 to 999), and to think of a number as being ABC (where A, B, and C are the 3 digits of a number)

  Testing a program based on varying

Testing a program based on varying input values without knowing what the code looks like is called _____.With _____ testing, you make sure that every instruction in the code is executed at least once.

  Smallest sequence of numbers in the array

Write a function called sum_smallest_sequence() that accepts an array of  signed  integers and the  number  of items in the array as arguments, and returns the sum of the smallest sequence of numbers in the array.

  Write program to count occurrences of each word in text

Write down C++ program to read following text. Count occurrences of each word in text and keep this count in list of elements containing (word, occurrence count) pairs.

  Draws a pyramid consisting of bricks

Write a C program that draws a pyramid consisting of bricks arranged in horizontal rows, so that the number of bricks in each row decreases by one as you move up the pyramid.

  Prompts the user to enter an integer

Write the code that prompts the user to enter an integer between 1 and 20 (including 1 and 20), reads the value using cin, and then prints the value that they entered in a statement that begins with "You entered a ". Save this version in a separate l..

  Attribute information about an array of floating point

Write a program that contains a main function and three other functions that will return various attribute information about an array of floating point

  Write program to declare the array of type float

Write down the c++ program which declares the array of 50 components of type float. Initialize array so that first 25 components are equal to square of the index variable.

  Write short c program to develops two processes

Write down a short C program which develops two processes. Each process must repeatedly write its own unique message to test file, one character at time. Do you see garbled messages in the file? Explain why or why not?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd