Problem 3 (40 points)-Write a program. Submit a file named chipotle.cpp Your fri
ID: 3914768 • Letter: P
Question
Problem 3 (40 points)-Write a program. Submit a file named chipotle.cpp Your friend here in university has an idea to make some extra money. She wants to make a delivery system for Chipotle using students (kept in a file). The program should give users the option to build an order (using actual Chipotle components) and then have a delivery person deliver it. For every order, there is a delivery charge (you decide what this charge is-for example, it can be a percentage of the order) Notes: -You should have a minimum of 2 classes (you decide which classes and how many) -The program should read in a file in the following format: Sample file: Serj TankianExplanation / Answer
#include<iostream>
using namespace std;
typedef struct delivery_Boy{
string name;
bool available;
}boy;
int main(){
int choice,more=1,i;
double price;
boy arr[100];
int count_boy=0;
string food,pick1,pick2,pick3,confirm;
do{
cout<<"1:customer 2:Apply 3:Exit ";
cin>>choice;
switch(choice){
case 1:{
cout<<"**place your order** ";
cout<<"Burrito Bowl ";
cin>>food;
if(food=="Burrito")price=6.75;
else if(food=="Bowl")price=10.75;
cout<<"Price will be $"<<price<<" ";
getline(cin,pick1);
cout<<"pick:Tofu,Steak,Chicken ";
getline(cin,pick1);
cout<<"pick:cilantro_lime brown,cilantro_lime white ";
getline(cin,pick2);
cout<<"pick:queso,Sour Cream,Fresh tomato Salsa Queso ";
getline(cin,pick3);
cout<<"confirm order (yes or no) ";
cout<<food<<":"<<pick1<< ", "<<pick2<<", "<<pick3<<" ";
cin>>confirm;
if(confirm=="yes"){
if(count_boy>0){
for(i=0;i<count_boy;i++){
if(arr[i].available==true){arr[i].available==false;break;}
}
if(i<count_boy)cout<<"OK,"<<arr[i].name<<" will take your order ";
else
cout<<"Sorry,delivery boy not available ";
}
else cout<<"Sorry,delivery boy not available ";
}
break;
}
case 2:{
cout<<"enter name ";
cin>>arr[count_boy].name;
arr[count_boy].available=true;
cout<<"Newest delivery person: "<<arr[count_boy].name<<" ";
count_boy++;
break;
}
case 3:{
more=0;
break;
}
}
}while(more==1);
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.