Answer:
Explanation:
copy to code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
//total bill amount
float totalBill=0;
//no of customers
int noOfCustomer=0;
//no of drinks
int noOfDrinks;
//drink type
char drinkType;
//no of sandwiches
int noOfSandwiches;
int sandWitchSize;
cout<<"Enter the number of customers : ";
cin>>noOfCustomer;
//loop through no of customers
for(int i=1;i<=noOfCustomer;i++){
totalBill=0;
cout<<"Enter how many drinks ? ";
cin>>noOfDrinks;
cout<<"Enter what kind of drink (S=Soda ,W=Water) ";
cin>>drinkType;
if(drinkType=='w' || drinkType=='W'){
totalBill +=noOfDrinks*1;
}else if(drinkType=='s' || drinkType=='S'){
totalBill +=noOfDrinks*2;
}
cout<<"How many Sandwiches : ";
cin>>noOfSandwiches;
cout<<"What size of sandwich (10/12 inches) ? :";
cin>>sandWitchSize;
if(sandWitchSize==10){
totalBill+= noOfSandwiches*3;
}else if(sandWitchSize==12){
totalBill+= noOfSandwiches*5;
}
cout<<"Your total bill "<<totalBill<<endl;
}
return 0;
}
Enter the number of customers : 2
How many drinks? 2
What kind of drink(S=Soda and W=Water)? w
How many sandwiches? 3
What size of sanwich(10/12inches) ? 12
Your total bill = $ 17
How many drinks? 4
What kind of drink(S=Soda and W=Water)? s
How many sandwiches? 4
What size of sanwich(10/12inches) ? 10
Your total bill = $ 20