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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
|
#include <iostream>
#include <cstdlib>
#include <limits>
using namespace std;
int main ()
{
// Varaiables for first set of orders*****************
string order1,order2,order3;
// Variables for main menu, side dish, and beverage********************
string main1 = "Main Dish 1",
main2 = "Main Dish 2",
main3 = "Main Dish 3",
main4 = "Main Dish 4",
main5 = "Main Dish 5",
side1 = "Side Dish 1",
side2 = "Side Dish 2",
side3 = "Side Dish 3",
side4 = "Side Dish 4",
side5 = "Side Dish 5",
bev1 = "Beverage 1",
bev2 = "Beverage 2",
bev3 = "Beverage 3",
bev4 = "Beverage 4",
bev5 = "Beverage 5";
//Variables for price************************
double mainprice1 = 100, mainprice2 = 120, mainprice3 = 140, mainprice4 = 160, mainprice5 = 180,
sideprice1 = 100, sideprice2 = 120, sideprice3 = 140, sideprice4 = 160, sideprice5 = 180,
bevprice1 = 100, bevprice2 = 120, bevprice3 = 140, bevprice4 = 160, bevprice5 = 180;
//This is for the ordered dish and their respective price
double price1,price2,price3;
double total1,total2,total3;
// This is for the Main dish, Side dish, and beverage selection variable********************
int MainDish, Sidedish, Beverage;
int ans;
//User information
string lastname,firstname,address,contactnumber;
char middleinitial;
//restuarant's front page****************************
cout<<endl<<endl<<endl<<endl;
cout<<"\t\t\t\tRestaurant Name\n";
system ("pause");
system ("cls");
do{
//Main Dish Selection**********************
do{
cout<<endl<<endl<<endl<<endl;
cout<<"Our Main Menu\n";
cout<<"(1)"<<main1<<"----------"<<mainprice1<<endl;
cout<<"(2)"<<main2<<"----------"<<mainprice2<<endl;
cout<<"(3)"<<main3<<"----------"<<mainprice3<<endl;
cout<<"(4)"<<main4<<"----------"<<mainprice4<<endl;
cout<<"(5)"<<main5<<"----------"<<mainprice5<<endl;
cout<<endl<<endl;
cout<<"Kindly select one\n";
cin>>MainDish;
system("cls");
if(cin.fail()) {
cin.clear();
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
//Switch for Maind Dish**************************
switch(MainDish)
{
case 1:
total1= mainprice1;
order1= main1;
price1=mainprice1;
break;
case 2:
total1=mainprice2;
order1=main2;
price1=mainprice2;
break;
case 3:
total1=mainprice3;
order1=main3;
price1=mainprice3;
break;
case 4:
total1=mainprice4;
order1=main4;
price1=mainprice4;
break;
case 5:
total1=mainprice5;
order1=main5;
price1=mainprice5;
break;
}
}while(!((MainDish== 1 )||(MainDish== 2 )||(MainDish== 3)||(MainDish== 4)||(MainDish== 5)));
//Side Dish Selection***************************
do{
cout<<endl<<endl<<endl<<endl;
cout<<"Our Side Dish\n";
cout<<"(1)"<<side1<<"----------"<<sideprice1<<endl;
cout<<"(2)"<<side2<<"----------"<<sideprice2<<endl;
cout<<"(3)"<<side3<<"----------"<<sideprice3<<endl;
cout<<"(4)"<<side4<<"----------"<<sideprice4<<endl;
cout<<"(5)"<<side5<<"----------"<<sideprice5<<endl;
cout<<endl<<endl;
cout<<"Kindly select one\n";
cin>>Sidedish;
system("cls");
if(cin.fail()) {
cin.clear();
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
//switch for side dish**********************
switch(Sidedish)
{ case 1:
total2= total1 + sideprice1;
order2= side1;
price2=sideprice1;
break;
case 2:
total2= total1 + sideprice2;
order2=side2;
price2=sideprice2;
break;
case 3:
total2=total1 + sideprice3;
order2=side3;
price2=sideprice3;
break;
case 4:
total2= total1 + sideprice4;
order2=side4;
price2=sideprice4;
break;
case 5:
total2=total1 + sideprice5;
order2=side5;
price2=sideprice5;
break;
default:
cout<<"Incorrect Input\n";
break;
}
}while(!((Sidedish== 1)||(Sidedish== 2)||(Sidedish== 3)||(Sidedish== 4)||(Sidedish== 5)));
//Beverage Selection************************
do{
cout<<endl<<endl<<endl<<endl;
cout<<"Our Beverage\n";
cout<<"(1)"<<bev1<<"----------"<<bevprice1<<endl;
cout<<"(2)"<<bev2<<"----------"<<bevprice2<<endl;
cout<<"(3)"<<bev3<<"----------"<<bevprice3<<endl;
cout<<"(4)"<<bev4<<"----------"<<bevprice4<<endl;
cout<<"(5)"<<bev5<<"----------"<<bevprice5<<endl;
cout<<endl<<endl;
cout<<"Kindly select one\n";
cin>>Beverage;
system("cls");
if(cin.fail()) {
cin.clear();
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
//switch for beverage**********************
switch(Beverage)
{ case 1:
total3= total2 + bevprice1;
order3= bev1;
price3=bevprice1;
break;
case 2:
total3= total2 + bevprice2;
order3=bev2;
price3=bevprice2;
break;
case 3:
total3= total2 + bevprice3;
order3=bev3;
price3=bevprice3;
break;
case 4:
total3= total2 + bevprice4;
order3=bev4;
price3=bevprice4;
break;
case 5:
total3= total2 +bevprice5;
order3=bev5;
price3=bevprice5;
break;
default:
cout<<"Incorrect Input\n";
break;
}
}while(!((Beverage== 1 )||(Beverage== 2 )||(Beverage== 3)||(Beverage== 4)||(Beverage== 5)));
system("cls");
//Confirmarion Page****************************
do {
cout<<endl<<endl<<endl;
cout<<"CONFIRMATION PAGE";
cout<<endl<<endl<<endl<<endl;
cout<<"You ordered the following:"<<endl;
cout<<order1<<endl<<order2<<endl<<order3<<endl;
cout<<endl<<endl;
cout<<"Do you want to order again?"<<endl;
cout<<"(1)Yes"<<endl;
cout<<"(2)No"<<endl;
cin>>ans;
if(cin.fail()) {
cin.clear();
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
switch (ans)
{case 1:
break;
case 2:
break;
default:
cout<<"Incorrect Input\n";
break;
}
system ("pause");
cout<<endl<<endl;
system ("cls");
}while (!((ans == 1 )||(ans == 2)));
system("cls");
}while (ans == 1);
//USER's INFORMATION**************************
system("cls");
cout<<endl;
cout<<"KINDLY COMPLETE THE FOLLOWING\n";
cout<<endl<<endl;
cout<<"Last Name\n";
cin>>lastname;
cout<<endl<<endl;
cout<<"Middle Initial\n";
cin>>middleinitial;
cout<<endl<<endl;
cout<<"First Name\n";
cin>>firstname;
cout<<endl<<endl;
cout<<"Contact Number\n";
cin>>contactnumber;
cout<<endl<<endl;
cout<<"Address\n";
cin>>address;
system("pause");
system("cls");
//Receipt*****************************
cout<<endl<<endl<<endl;
cout<<"Customer: "<<firstname<<" "<<middleinitial<<". "<<lastname<<endl;
cout<<"Contact Details: "<<contactnumber<<endl<<endl;
cout<<"Address:"<<address<<endl<<endl;
cout<<"___________________________________________________"<<endl;
cout<<"ORDER DETAILS"<<endl<<endl;
cout<<order1<<"\t\tP"<<price1<<endl;
cout<<order2<<"\t\tP"<<price2<<endl;
cout<<order3<<"\t\tP"<<price3<<endl<<endl;
cout<<"\tWITH A TOTAL OF P"<<total3<<endl;
cout<<"___________________________________________________"<<endl<<endl<<endl;
return 0;
}
|