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
|
//menu
#include <iostream> //Important stuff
#include <iomanip>
#include <string>
using namespace std;
int main () //Defining variables for codes to work
{
int a,
b,
c,
d,
e,
item1,
item2,
item3,
item4,
item5,
w = 0,
x = 0,
y = 0,
z = 0;
const double Salad1 = 4.50,
Soup1 = 8.50,
Chicken1 = 11.00,
Cheesecake1 = 5.00,
tax = 1.09;
double total1,
total2,
total3,
total4,
total5;
//Having the customer pick how many of something they want
//First we tell them what we have and we ask them what they want and how many
//Then we use cin as a way to plug in the number to use later for the bill.
cout << "Welcome to CSUF dinings, here is our menu." << endl;
cout << "1. Salad - $4.50" << endl;
cout << "2. Soup - $8.50" << endl;
cout << "3. Chicken - $11.00" << endl;
cout << "4. Cheesecake - $5.00" << endl;
cout << "Enter in the number of the item you would like to order. And how many of it would you like?" << endl;
cin >> item1 >> a;
if (item1 == 1)
{total1 = Salad1*a;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1 << "." << endl;
w = a;
}
else if (item1 == 2)
{total1 = Soup1*a;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1 << "." << endl;
x = a;
}
else if (item1 == 3)
{total1 = Chicken1*a;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1 << "." << endl;
y = a;
}
else if (item1 == 4)
{total1 = Cheesecake1*a;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1 << "." << endl;
z = a;
}
cout << endl;
cout << "What else would you like? Enter in the number of the item you would like to order. And how many of it would you like? If you are done ordering, enter in 5 and 0." << endl;
cout << "1. Salad - $4.50" << endl;
cout << "2. Soup - $8.50" << endl;
cout << "3. Chicken - $11.00" << endl;
cout << "4. Cheesecake - $5.00" << endl;
cin >> item2 >> b;
if (item2 == 1)
{total2 = Salad1*b;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2 << "." << endl;
w += b;
}
else if (item2 == 2)
{total2 = Soup1*b;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2 << "." << endl;
x += b;
}
else if (item2 == 3)
{total2 = Chicken1*b;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2 << "." << endl;
y += b;
}
else if (item2 == 4)
{total2 = Cheesecake1*b;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2 << "." << endl;
z += b;
}
else if (item2 == 5)
{
cout << endl;
if (w == 1)
{cout << "You ordered " << w << " salad." << endl;
}
if (w >= 2)
{ cout << "You ordered " << w << " salads." << endl;
}
if (x == 1)
{cout << "You ordered " << x << " soup." << endl;
}
if (x >= 2)
{cout << "You ordered " << x << " soups." << endl;
}
if (y == 1)
{cout << "You ordered " << y << " chicken." << endl;
}
if (y >= 2)
{cout << "You ordered " << y << " chickens." << endl;
}
if (z == 1)
{cout << "You ordered " << z << " cheesecake." << endl;
}
if (z >= 2)
{cout << "You ordered " << z << " cheesecakes." << endl;
}
cout << "Your total will be $" << setprecision(2) << fixed << (total1)*tax << "." << endl;
cout << "Thank you for ordering at CSUF dinings, and have a nice day!" << endl;
return 0;
}
cout << endl;
cout << "What else would you like? Enter in the number of the item you would like to order. And how many of it would you like? If you are done ordering, enter in 5 and 0." << endl;
cout << "1. Salad - $4.50" << endl;
cout << "2. Soup - $8.50" << endl;
cout << "3. Chicken - $11.00" << endl;
cout << "4. Cheesecake - $5.00" << endl;
cin >> item3 >> c;
if (item3 == 1)
{total3 = Salad1*c;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3 << "." << endl;
w += c;
}
else if (item3 == 2)
{total3 = Soup1*c;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3 << "." << endl;
x += c;
}
else if (item3 == 3)
{total3 = Chicken1*c;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3 << "." << endl;
y += c;
}
else if (item3 == 4)
{total3 = Cheesecake1*c;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3 << "." << endl;
z += c;
}
else if (item3 == 5)
{
cout << endl;
if (w == 1)
{cout << "You ordered " << w << " salad." << endl;
}
if (w >= 2)
{ cout << "You ordered " << w << " salads." << endl;
}
if (x == 1)
{cout << "You ordered " << x << " soup." << endl;
}
if (x >= 2)
{cout << "You ordered " << x << " soups." << endl;
}
if (y == 1)
{cout << "You ordered " << y << " chicken." << endl;
}
if (y >= 2)
{cout << "You ordered " << y << " chickens." << endl;
}
if (z == 1)
{cout << "You ordered " << z << " cheesecake." << endl;
}
if (z >= 2)
{cout << "You ordered " << z << " cheesecakes." << endl;
}
cout << "Your total will be $" << setprecision(2) << fixed << (total1+total2)*tax << endl;
cout << "Thanks for ordering at CSUF dinings, and have a nice day!" << endl;
return 0;
}
cout << endl;
cout << "What else would you like? Enter in the number of the item you would like to order. And how many of it would you like? If you are done ordering, enter in 5 and 0." << endl;
cout << "1. Salad - $4.50" << endl;
cout << "2. Soup - $8.50" << endl;
cout << "3. Chicken - $11.00" << endl;
cout << "4. Cheesecake - $5.00" << endl;
cin >> item4 >> d;
if (item4 == 1)
{total4 = Salad1*d;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3+total4 << "." << endl;
w += d;
}
else if (item4 == 2)
{total4 = Soup1*d;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3+total4 << "." << endl;
x += d;
}
else if (item4 == 3)
{total4 = Chicken1*d;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3+total4 << "." << endl;
y += d;
}
else if (item4 == 4)
{total4 = Cheesecake1*d;
cout << "Your total so far will be $" << setprecision(2) << fixed << total1+total2+total3+total4 << "." << endl;
z += d;
}
else if (item4 == 5)
{
cout << endl;
if (w == 1)
{cout << "You ordered " << w << " salad." << endl;
}
if (w >= 2)
{ cout << "You ordered " << w << " salads." << endl;
}
if (x == 1)
{cout << "You ordered " << x << " soup." << endl;
}
if (x >= 2)
{cout << "You ordered " << x << " soups." << endl;
}
if (y == 1)
{cout << "You ordered " << y << " chicken." << endl;
}
if (y >= 2)
{cout << "You ordered " << y << " chickens." << endl;
}
if (z == 1)
{cout << "You ordered " << z << " cheesecake." << endl;
}
if (z >= 2)
{cout << "You ordered " << z << " cheesecakes." << endl;
}
cout << "Your total will be $" << setprecision(2) << fixed << (total1+total2+total3)*tax << endl;
cout << "Thanks for ordering at CSUF dinings, and have a nice day!" << endl;
return 0;
}
return 0;
}
|