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;
}
}
}
//************************************************************
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?
|