I need to break down the program into function calls and prompts the user for an order until he exits the program

Pages: 12
Write your question here.

#include <iostream>
#include <iomanip>
using namespace std;

int main()

{

int ColdSandwichesWithChips, SideOrder, BeveragesAndWater;
double TotalBill, ColdSand, SiOr, Bev;


double Turkey = 2.50;
double RoastBeef = 4.95;
double HamAndCheese = 4.95;
double Tuna = 3.95;
double DeluxeMix = 4.95;
double FrenchFries = 2.50;
double OnionRings = 2.75;
double MacaroniAndCheese = 2.50;
double ColeSlaw = 2.25;
double Pepsi = 1.25;
double Orange = 1.25;
double MountainDew = 1.25;
double RootBeer = 1.25;
double Water = 1.00;
double SierraMist = 1.25;
double OrangeJuice = 1.50;
double AppleJuice = 1.50;

// Display the menu choices
cout << "COLD SANDWICHES w/chips: \n\n";
cout << "1- TURKEY w/mayo, lettuce, toamto, onion, & slice of cranberry sauce \n";
cout << "2- ROAST BEEF w/Russian dressing \n";
cout << "3- HAM & CHEESE \n";
cout << "4- TUNA w/mayo, lettuce, tomato \n";
cout << "5- DELUXE MIX w/lettuce, tomato, onion, dressing \n";
cout << "\n\n";

// Allows the user to select a cold sandwich
cout << "Select a sandwich number from Chuckie's Kitchen Cold Sandwiches: ";
cin >> ColdSandwichesWithChips;

if (ColdSandwichesWithChips == 1)
{
ColdSand = Turkey;
}
else if (ColdSandwichesWithChips == 2)
{
ColdSand = RoastBeef;
}
else if (ColdSandwichesWithChips == 3)
{
ColdSand = HamAndCheese;
}
else if (ColdSandwichesWithChips == 4)
{
ColdSand = Tuna;
}
else
{
ColdSand = DeluxeMix;
}

cout << "\n";
cout << "SIDE ORDERS: \n\n";
cout << "1- FRENCH FRIES \n";
cout << "2- ONION RINGS \n";
cout << "3- MACARONI & CHESSE \n";
cout << "4- COLE SLAW \n";
cout << "\n\n";

// Allows the user to select a side order
cout << "Select a side order number from Chuckie's Kitchen Side Orders: ";
cin >> SideOrder;

if (SideOrder == 1)
{
SiOr = FrenchFries;
}
else if (SideOrder == 2)
{
SiOr = OnionRings;
}
else if (SideOrder == 3)
{
SiOr = MacaroniAndCheese;
}
else
{
SiOr = ColeSlaw;
}

cout << "\n";
cout << "BEVERAGES & WATER: \n\n";
cout << "1- PEPSI \n";
cout << "2- ORANGE \n";
cout << "3- MOUNTAIN DEW \n";
cout << "4- ROOT BEER \n";
cout << "5- WATER \n";
cout << "6- SIERRA MIST \n";
cout << "7- ORANGE JUICE \n";
cout << "8- APPLE JUICE \n";
cout << "\n\n";

// Allows the user to select a beverage
cout << "Select a beverage number from Chuckie's Kitchen Beverages & Water: ";
cin >> BeveragesAndWater;

if (BeveragesAndWater == 1)
{
Bev = Pepsi;
}
else if (BeveragesAndWater == 2)
{
Bev = Orange;
}
else if (BeveragesAndWater == 3)
{
Bev = MountainDew;
}
else if (BeveragesAndWater == 4)
{
Bev = RootBeer;
}
else if (BeveragesAndWater == 5)
{
Bev = Water;
}
else if (BeveragesAndWater == 6)
{
Bev = SierraMist;
}
else if (BeveragesAndWater == 7)
{
Bev = OrangeJuice;
}
else
{
Bev = AppleJuice;
}

// Computes the total bill
cout << "\n";
TotalBill = ColdSand + SiOr + Bev;

cout.precision(2);
cout << fixed << "Your total bill is " << TotalBill << "." << endl;

return 0;
}
Last edited on
So what are the things you're doing in your program?
- Display the menu choices
- Select a cold sandwich
- Select a side order
- Select a beverage
- Compute the bill
Do those sound like things that can be put into functions?

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
http://v2.cplusplus.com/articles/jEywvCM9/
It makes it easier to read your code and it also makes it easier to respond to your post.
Last edited on
Yes I did the first part which is this program, now I have to break it into function calls and prompt the user to exit the program after he take the order. Then print the receipt of what he ordered.
It says exactly: In Lab 2 you will modularize Lab 1 (which is the above program). This means, you will break down the various components of the program into functions. You should also prompt the user for an order until the user chooses to exit the program. This time, be sure to print a receipt that includes what the user ordered and the item's cost. At the top of the receipt, add the name and address of the restaurant. (Note: You do NOT need to implement using arrays).

I THINK THAT A LOOP SHOULD BE USED.
[b]Please someone help this Lab exercise is due tomorrow... Please!![/b]
I already gave you suggestions of what to put into functions. We're not going to do your homework for you.

If you don't understand functions, then I suggest your review the tutorial.
http://www.cplusplus.com/doc/tutorial/functions/

If you get stuck, show us what you have done and we'll try and help.
Okay I'll try as much as I can and post my work. Thank you so much! Please keep in touch :)!
I did everything needed for the program, but I have errors which say that some variables were not declared though I declared them. If you may please check the reason; here's my program:

#include <iostream>
#include <iomanip>
using namespace std;

int ColdSandwichesWithChips, SideOrder, BeveragesAndWater;
void FinalBill (double TotalBill, double ColdSand, double SiOr, double Bev);
int ColdSands (int);
int SideOrders (int);
int Beverages (int);

int main()

{

double Turkey = 2.50;
double RoastBeef = 4.95;
double HamAndCheese = 4.95;
double Tuna = 3.95;
double DeluxeMix = 4.95;
double FrenchFries = 2.50;
double OnionRings = 2.75;
double MacaroniAndCheese = 2.50;
double ColeSlaw = 2.25;
double Pepsi = 1.25;
double Orange = 1.25;
double MountainDew = 1.25;
double RootBeer = 1.25;
double Water = 1.00;
double SierraMist = 1.25;
double OrangeJuice = 1.50;
double AppleJuice = 1.50;

// Displays the choices
void ColdSands()
{
cout << "COLD SANDWICHES w/chips: \n\n";
cout << "1- TURKEY w/mayo, lettuce, tomato, onion, & slice of cranberry sauce \n";
cout << "2- ROAST BEEF w/Russian dressing \n";
cout << "3- HAM & CHEESE \n";
cout << "4- TUNA w/mayo, lettuce, tomato \n";
cout << "5- DELUXE MIX w/lettuce, tomato, onion, dressing \n";
cout << "\n\n";
}

// Allows the user to select a cold sandwich
cout << "Select a sandwich by its number from Chuckie's Kitchen Cold Sandwiches: ";
cin >> ColdSandwichesWithChips;

if (ColdSandwichesWithChips == 1)
{
ColdSand = Turkey;
}
else if (ColdSandwichesWithChips == 2)
{
ColdSand = RoastBeef;
}
else if (ColdSandwichesWithChips == 3)
{
ColdSand = HamAndCheese;
}
else if (ColdSandwichesWithChips == 4)
{
ColdSand = Tuna;
}
else
{
ColdSand = DeluxeMix;
}

// Displays the choices
void SideOrders()
{
cout << "\n";
cout << "SIDE ORDERS: \n\n";
cout << "1- FRENCH FRIES \n";
cout << "2- ONION RINGS \n";
cout << "3- MACARONI & CHESSE \n";
cout << "4- COLE SLAW \n";
cout << "\n\n";
}

// Allows the user to select a side order
cout << "Select a side order by its number from Chuckie's Kitchen Side Orders: ";
cin >> SideOrder;

if (SideOrder == 1)
{
SiOr = FrenchFries;
}
else if (SideOrder == 2)
{
SiOr = OnionRings;
}
else if (SideOrder == 3)
{
SiOr = MacaroniAndCheese;
}
else
{
SiOr = ColeSlaw;
}

// Displays the choices
void Beverages()
{
cout << "\n";
cout << "BEVERAGES & WATER: \n\n";
cout << "1- PEPSI \n";
cout << "2- ORANGE \n";
cout << "3- MOUNTAIN DEW \n";
cout << "4- ROOT BEER \n";
cout << "5- WATER \n";
cout << "6- SIERRA MIST \n";
cout << "7- ORANGE JUICE \n";
cout << "8- APPLE JUICE \n";
cout << "\n\n";
}

// Allows the user to select a beverage
cout << "Select a beverage by its number from Chuckie's Kitchen Beverages & Water: ";
cout << "\n";
cin >> BeveragesAndWater;

if (BeveragesAndWater == 1)
{
Bev = Pepsi;
}
else if (BeveragesAndWater == 2)
{
Bev = Orange;
}
else if (BeveragesAndWater == 3)
{
Bev = MountainDew;
}
else if (BeveragesAndWater == 4)
{
Bev = RootBeer;
}
else if (BeveragesAndWater == 5)
{
Bev = Water;
}
else if (BeveragesAndWater == 6)
{
Bev = SierraMist;
}
else if (BeveragesAndWater == 7)
{
Bev = OrangeJuice;
}
else
{
Bev = AppleJuice;
}

// Computes the total bill
void FinalBill()
{
cout << "\n";
TotalBill = ColdSand + SiOr + Bev;
}

cout.precision(2);
cout << "Your Receipt:";
cout << "\n\n\t\t\t Chuckie's KITCHEN" << endl;
cout << "\n";
cout << "\t\t\t 245 GREEN ST. \n\n";
cout << "\t\t at 4th Ave & Green St, Albany, NY \n\n";
cout << "\t\t Store Telephone #: 449-0720 \n\n\n";
cout << fixed << "Your total bill is $" << TotalBill << "." << endl;
cout << "\n\n\n";
cout << "Come Again!:)" << endl;

return 0;
}
Here are the errors:

48 1 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token
64 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'ColdSand' was not declared in this scope
68 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'ColdSand' was not declared in this scope
72 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'ColdSand' was not declared in this scope
76 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'ColdSand' was not declared in this scope
80 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'ColdSand' was not declared in this scope
85 1 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token
101 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'SiOr' was not declared in this scope
105 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'SiOr' was not declared in this scope
109 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'SiOr' was not declared in this scope
113 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'SiOr' was not declared in this scope
118 1 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token
139 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
143 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
147 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
151 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
155 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
159 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
163 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
167 3 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'Bev' was not declared in this scope
172 1 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token
184 44 C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'TotalBill' was not declared in this scope
You can't define functions within functions. You can call a function in main, but the definition of that function is going to be separate and outside of the main opening and closing curly braces.

In the function prototype for FinalBill, the code says the function will receive four double parameters, but those variables are never actually defined in the main function. (You did have them defined in your original post)
void FinalBill (double TotalBill, double ColdSand, double SiOr, double Bev);

Also - your function prototypes don't match up with the function definitions later on in terms of return type and parameters sent.
void FinalBill (double TotalBill, double ColdSand, double SiOr, double Bev);
void FinalBill()
int ColdSands (int);
void ColdSands()
int SideOrders (int);
void SideOrders()
int Beverages (int);
void Beverages()
Okay so I took ColdSand, SiOr and Bev to the main function, should I take total bill too and just put:
void FinalBill(); or void FinalBill(TotalBill); ?

How should I place the tokens?

it also says:
C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token

C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token

C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token

C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] a function-definition is not allowed here before '{' token

C:\Users\hometech\Documents\WElHouraniLab1.cpp [Error] 'TotalBill' was not declared in this scope
I did everything and made major changes; my program is compiling but when black box opens it tells that: process exited with return value 0.
**I tried removing the return 0; nothing changed. Here is my program:

#include <iostream>
#include <iomanip>
using namespace std;

void FinalBill (double ColdSand, double SiOr, double Bev);
double TotalBill;
int ColdSandwichesWithChips, SideOrder, BeveragesAndWater;
int ColdSands (int);
int SideOrders (int);
int Beverages (int);
double ColdSand,
SiOr,
Bev;

int main()

{
double Turkey = 2.50;
double RoastBeef = 4.95;
double HamAndCheese = 4.95;
double Tuna = 3.95;
double DeluxeMix = 4.95;
double FrenchFries = 2.50;
double OnionRings = 2.75;
double MacaroniAndCheese = 2.50;
double ColeSlaw = 2.25;
double Pepsi = 1.25;
double Orange = 1.25;
double MountainDew = 1.25;
double RootBeer = 1.25;
double Water = 1.00;
double SierraMist = 1.25;
double OrangeJuice = 1.50;
double AppleJuice = 1.50;

cout << fixed << showpoint << setprecision (2);

if (ColdSandwichesWithChips == 1)
{
ColdSand = Turkey;
}
else if (ColdSandwichesWithChips == 2)
{
ColdSand = RoastBeef;
}
else if (ColdSandwichesWithChips == 3)
{
ColdSand = HamAndCheese;
}
else if (ColdSandwichesWithChips == 4)
{
ColdSand = Tuna;
}
else
{
ColdSand = DeluxeMix;
}


if (SideOrder == 1)
{
SiOr = FrenchFries;
}
else if (SideOrder == 2)
{
SiOr = OnionRings;
}
else if (SideOrder == 3)
{
SiOr = MacaroniAndCheese;
}
else
{
SiOr = ColeSlaw;
}

if (BeveragesAndWater == 1)
{
Bev = Pepsi;
}
else if (BeveragesAndWater == 2)
{
Bev = Orange;
}
else if (BeveragesAndWater == 3)
{
Bev = MountainDew;
}
else if (BeveragesAndWater == 4)
{
Bev = RootBeer;
}
else if (BeveragesAndWater == 5)
{
Bev = Water;
}
else if (BeveragesAndWater == 6)
{
Bev = SierraMist;
}
else if (BeveragesAndWater == 7)
{
Bev = OrangeJuice;
}
else
{
Bev = AppleJuice;
}

return 0;
}

// Displays the choices
void ColdSands()
{
cout << "COLD SANDWICHES w/chips: \n\n";
cout << "1- TURKEY w/mayo, lettuce, tomato, onion, & slice of cranberry sauce \n";
cout << "2- ROAST BEEF w/Russian dressing \n";
cout << "3- HAM & CHEESE \n";
cout << "4- TUNA w/mayo, lettuce, tomato \n";
cout << "5- DELUXE MIX w/lettuce, tomato, onion, dressing \n";
cout << "\n\n";

// Allows the user to select a cold sandwich
cout << "Select a sandwich by its number from Chuckie's Kitchen Cold Sandwiches: ";
cin >> ColdSandwichesWithChips;
}


// Displays the choices
void SideOrders()
{
cout << "\n";
cout << "SIDE ORDERS: \n\n";
cout << "1- FRENCH FRIES \n";
cout << "2- ONION RINGS \n";
cout << "3- MACARONI & CHESSE \n";
cout << "4- COLE SLAW \n";
cout << "\n\n";

// Allows the user to select a side order
cout << "Select a side order by its number from Chuckie's Kitchen Side Orders: ";
cin >> SideOrder;
}


// Displays the choices
void Beverages()
{
cout << "\n";
cout << "BEVERAGES & WATER: \n\n";
cout << "1- PEPSI \n";
cout << "2- ORANGE \n";
cout << "3- MOUNTAIN DEW \n";
cout << "4- ROOT BEER \n";
cout << "5- WATER \n";
cout << "6- SIERRA MIST \n";
cout << "7- ORANGE JUICE \n";
cout << "8- APPLE JUICE \n";
cout << "\n\n";

// Allows the user to select a beverage
cout << "Select a beverage by its number from Chuckie's Kitchen Beverages & Water: ";
cout << "\n";
cin >> BeveragesAndWater;
}

//Displays the total bill
void FinalBill()
{
TotalBill = ColdSand + SiOr + Bev;

cout << "\n";
cout << "Your Receipt:";
cout << "\n\n\t\t\t Chuckie's KITCHEN" << endl;
cout << "\n";
cout << "\t\t\t 245 GREEN ST. \n\n";
cout << "\t\t at 4th Ave & Green St, Albany, NY \n\n";
cout << "\t\t Store Telephone #: 449-0720 \n\n\n";
cout << fixed << "Your total bill is $" << TotalBill << "." << endl;
cout << "\n\n\n";
cout << "Come Again!:)" << endl;
}
You still need to call the functions from main to have them execute. Basically this is the order the different sections go in.

// include statements
// function prototypes (must match how you call function in main and define function in terms of return type and parameters)
// main function
// function definitions


Here's an example using one of the functions you have just to illustrate how it might work.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
using namespace std;

//function prototype
int ColdSands();  //function doesn't take a parameter but does return the value of the option person selected from the menu

//main function - program entry
int main() 
{
	int ColdSandwichesWithChips; //variable to hold result of ColdSands function
	
	//store value returned from Sandwich menu function in ColdSandwichesWithChips
	ColdSandwichesWithChips = ColdSands(); 

	if (ColdSandwichesWithChips == 1)
	//... the if/else statements
	
	return 0;
}

//function definition
int ColdSands()
{
	int n; // declare variable to store menu choice 
	cout << "COLD SANDWICHES w/chips: \n\n";
	cout << "1- TURKEY w/mayo, lettuce, tomato, onion, & slice of cranberry sauce \n";
	cout << "2- ROAST BEEF w/Russian dressing \n";
	cout << "3- HAM & CHEESE \n";
	cout << "4- TUNA w/mayo, lettuce, tomato \n";
	cout << "5- DELUXE MIX w/lettuce, tomato, onion, dressing \n";
	cout << "\n\n";

	// Allows the user to select a cold sandwich
	cout << "Select a sandwich by its number from Chuckie's Kitchen Cold Sandwiches: ";
	cin >> n;

	//return value selected back to main function
	return n;
}
One more question please: should I do more than 1 main function or include all of the if/else statements in the only 1 main funtion?
and you did not use void though..
There is only one main function to a program.

If you want the function to return a value you can use back in the calling function, the function can't be void.
It's not working and I only have an hour to submit it.. Do I have to put all the if/else in the main function?
If you're returning the menu choices to a variable in main to be evaluated that's where you'd put the if/else statements.
May I PLEASEEEE know what's wrong about this? I have to turn this in in 50 minutes or I'll score a 0. Please help pleaseeee!

#include <iostream>
#include <iomanip>
using namespace std;

//Declaring variables
void FinalBill (double ColdSand, double SiOr, double Bev);
double TotalBill;
int ColdSands (int);
int SideOrders (int);
int Beverages (int);
double ColdSand,
SiOr,
Bev;

//Main function
int main()
{
int ColdSandwichesWithChips,
SideOrder,
BeveragesAndWater;
ColdSandwichesWithChips = int ColdSands();
SideOrders = int SiOr();
Beverages = int Bev();


double Turkey = 2.50;
double RoastBeef = 4.95;
double HamAndCheese = 4.95;
double Tuna = 3.95;
double DeluxeMix = 4.95;
double FrenchFries = 2.50;
double OnionRings = 2.75;
double MacaroniAndCheese = 2.50;
double ColeSlaw = 2.25;
double Pepsi = 1.25;
double Orange = 1.25;
double MountainDew = 1.25;
double RootBeer = 1.25;
double Water = 1.00;
double SierraMist = 1.25;
double OrangeJuice = 1.50;
double AppleJuice = 1.50;

cout << fixed << showpoint << setprecision (2);

return 0;
}

// Displays the choices
ColdSands()
{
cout << "COLD SANDWICHES w/chips: \n\n";
cout << "1- TURKEY w/mayo, lettuce, tomato, onion, & slice of cranberry sauce \n";
cout << "2- ROAST BEEF w/Russian dressing \n";
cout << "3- HAM & CHEESE \n";
cout << "4- TUNA w/mayo, lettuce, tomato \n";
cout << "5- DELUXE MIX w/lettuce, tomato, onion, dressing \n";
cout << "\n\n";
}

if (ColdSandwichesWithChips == 1)
{
ColdSand = Turkey;
}
else if (ColdSandwichesWithChips == 2)
{
ColdSand = RoastBeef;
}
else if (ColdSandwichesWithChips == 3)
{
ColdSand = HamAndCheese;
}
else if (ColdSandwichesWithChips == 4)
{
ColdSand = Tuna;
}
else
{
ColdSand = DeluxeMix;
}


// Allows the user to select a cold sandwich
{
cout << "Select a sandwich by its number from Chuckie's Kitchen Cold Sandwiches: ";
cin >> ColdSandwichesWithChips;
return ColdSandwichesWithChips;
}

// Displays the choices
SiOr ()
{
cout << "\n";
cout << "SIDE ORDERS: \n\n";
cout << "1- FRENCH FRIES \n";
cout << "2- ONION RINGS \n";
cout << "3- MACARONI & CHESSE \n";
cout << "4- COLE SLAW \n";
cout << "\n\n";
}
if (SideOrder == 1)
{
SiOr = FrenchFries;
}
else if (SideOrder == 2)
{
SiOr = OnionRings;
}
else if (SideOrder == 3)
{
SiOr = MacaroniAndCheese;
}
else
{
SiOr = ColeSlaw;
}

// Allows the user to select a side order
{
cout << "Select a side order by its number from Chuckie's Kitchen Side Orders: ";
cin >> SideOrder;
return SideOrder;
}

// Displays the choices
Bev()
{
cout << "\n";
cout << "BEVERAGES & WATER: \n\n";
cout << "1- PEPSI \n";
cout << "2- ORANGE \n";
cout << "3- MOUNTAIN DEW \n";
cout << "4- ROOT BEER \n";
cout << "5- WATER \n";
cout << "6- SIERRA MIST \n";
cout << "7- ORANGE JUICE \n";
cout << "8- APPLE JUICE \n";
cout << "\n\n";
}
if (BeveragesAndWater == 1)
{
Bev = Pepsi;
}
else if (BeveragesAndWater == 2)
{
Bev = Orange;
}
else if (BeveragesAndWater == 3)
{
Bev = MountainDew;
}
else if (BeveragesAndWater == 4)
{
Bev = RootBeer;
}
else if (BeveragesAndWater == 5)
{
Bev = Water;
}
else if (BeveragesAndWater == 6)
{
Bev = SierraMist;
}
else if (BeveragesAndWater == 7)
{
Bev = OrangeJuice;
}
else
{
Bev = AppleJuice;
}

// Allows the user to select a beverage
{
cout << "Select a beverage by its number from Chuckie's Kitchen Beverages & Water: ";
cout << "\n";
cin >> BeveragesAndWater;
return BeveragesAndWater;
}


//Displays the total bill
void FinalBill()
{
TotalBill = ColdSand + SiOr + Bev;

cout << "\n";
cout << "Your Receipt:";
cout << "\n\n\t\t\t Chuckie's KITCHEN" << endl;
cout << "\n";
cout << "\t\t\t 245 GREEN ST. \n\n";
cout << "\t\t at 4th Ave & Green St, Albany, NY \n\n";
cout << "\t\t Store Telephone #: 449-0720 \n\n\n";
cout << fixed << "Your total bill is $" << TotalBill << "." << endl;
cout << "\n\n\n";
cout << "Come Again!:)" << endl;
}
Please someone help I've been working on this for 6 hours now and I have to turn it in in 45 minutes or I score a 0!! :/ I tried as much as I can...
Pages: 12