pizza program
program to be used at a pizza joint cash register */
#include
using namespace std;
int main()
{
int menu_choice;
float cost;
char answer;
do
{
do
{
cout << "******** MENU ********\n"; cout << "1) Small Pizza\n"; cout << "2) Large Pizza\n"; cout << "3) Breadsticks\n"; cout << "4) Dozen Wings\n"; cout << "5) Jojo's\n"; cout << "6) Calzone\n"; cout << "7) Soda 2litre\n\n"; cout << "Please choose your item: "; cin >> menu_choice;
if (menu_choice == 1)
{
cost = cost + 8.75;
}
else if (menu_choice == 2)
{
cost = cost + 11.25;
}
else if (menu_choice == 3)
{
cost = cost + 3.50;
}
else if (menu_choice == 4)
{
cost = cost + 7;
}
else if (menu_choice == 5)
{
cost = cost + 4.5;
}
else if (menu_choice == 6)
{
cost = cost + 9;
}
else if (menu_choice == 7)
{
cost = cost + 2.25;
}
else
{
cout << "Invalid choice. Try Again.\n"; } cout << "Would you like to add more items? (y/n) "; cin >> answer;
} while(answer == 'y');
No comments:
Post a Comment