#include <iostream>
#include <cstdlib>
usingnamespace std;
int main()
{
int SIZE=5;
double COFFEEPRICE=2.00;
string products[5]="Whipped Cream"; "Cinnamon"; "Chocolate Sauce"; "Amaretto"; "Irish Whisky";
double prices[5]=0.89; 0.25; 0.59; 1.50; 1.75;
double totalPrice=0;
int choice=0;
int SENTINEL=-1;
while(choice!=-1)
cout<<"Please select an item from the Product menu by selecting the item number (1 - 5) or -1 to terminate: "<<endl;
cout<<"Product Price ($)"<<endl;
cout<<"======= ========="<<endl;
cout<<"1. Whipped cream 0.89"<<endl;
cout<<"2. Cinnamon 0.25"<<endl;
cout<<"3. Chocolate sauce 0.89"<<endl;
cout<<"4. Amaretto 1.50"<<endl;
cout<<"5. Irish whiskey 1.75"<<endl;
cout<<"Please enter a positive number: "<<endl;
cin>>choice;
if(choice!=-1)
{
if((choice>=1)&&(choice<=5))
{
totalPrice=totalPrice+prices[choice-1];
cout<<"Item number "<<choice<<": "<<products[choice-1]<<" has been added"<<endl;
}
else
{
cout<<"Item number "<<choice<<" is not valid"<<"Sorry we do not carry that item"<<endl;
}
}
cout<<"Total price of order is "<<totalPrice<<endl;
cout<<"Thanks for purchasing from Jumpin Jive Coffee Shop"<<endl;
system("PAUSE");
return 0;
}
Thanks! There was another problem I ran into as well, I didn't open and close my while function x) Also, the psuedocode was given to us by our teacher, and this program does not include the coffee price in the total price. What is a good way to go about adding the coffee price, once, to the total price?