#include "stdafx.h"
#include
<iostream>
using
namespace std;
int
ListMainOptions()
{
int choice;
cout<<"Please Select One Of The Following:" << endl;
cout<<"1- Food Menu. " << endl;
cout<<"2- Calculate Daily Profits."<<endl;
cout<<"3- Quit."<<endl;
cin>>choice;
return choice;
}
bool
OtherChoice ()
{
char c;
cout << "\nDo You Want To Add Another Order?\n";
cin >> c;
if ( c == 'Y' || c == 'y' )
returntrue;
elseif ( c == 'N' || c == 'n' )
returnfalse;
returnfalse;
}
void
FoodMenu()
{
int sum = 0;
int choice;
while ( true )
{
cout << "1- Beef Burger . 10 SR\n2-French fires. 4 SR\n3-Pepsi. 2 SR\n4-Pizza. 15 SR\n";
cin >> choice;
if ( choice == 1 )
{
sum += 10;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
elseif ( choice == 2 )
{
sum += 4;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
elseif ( choice == 3 )
{
sum += 2;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
elseif ( choice == 4 )
{
sum += 15;
if ( OtherChoice() )
continue;
else
{
cout << "\nTotal price: "<<sum;
break;
}
}
else
cout<<"Invalid Selection, Please Select 1, 2, 3 or 4\n";
}
}
void
CalculateProfits()
{
int outcome, income;
cout<<"\nPlease enter the day outcome: ";
cin >> outcome;
cout << "Please enter the day income";
cin >> income;
cout << "The Day Profit is : " << income - outcome ;
}
int
main()
{
while ( true )
{
int userChoice;
userChoice = ListMainOptions();
if ( userChoice == 1 )
FoodMenu();
elseif ( userChoice == 2 )
CalculateProfits();
elseif ( userChoice == 3 )
break;
else
cout << "Invalid Selection, Please Select 1, 2 or 3";
continue;
}
return 0;
}