I have to write a program asking the user what type of sandwich they would like. I know how to do that part using switch but how do I get it to show the price only for that sandwich.
This is what I have so far.
Now how do I show the user their total? Say they pick turkey, how do I write a cout statement so it only shows the turkey total. I know I have to use the if statement but now sure how to.Code:#include <iostream.h>
#include <iomanip.h>
int main()
{
int salami;
int cheese;
int turkey;
int order;
double food;
cout << "What would you like to order" << endl;
cout << "s - Salami" << endl;
cout << "c - Cheese" << endl;
cout << "t - Turkey" << endl;
cout << "n - No Order" << endl;
cin >> order;
switch (order)
{
case 's':
food = 5.59;
break;
case 'c':
food = 4.49;
break;
case 't':
food = 2.39;
break;
case 'n':
food = 5.59;
break;
return 0;
}
}