Your friend here in university has an idea to make some extra money. She wants t
ID: 3910587 • Letter: Y
Question
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 Tankian <-Serj is the delivery person’s first name and Tankian is the last name Daron Malakian Shavo Odadjian John Dolmayan -The program should give the user the following options: -Customer (meaning you will put in your order and have it delivered by a delivery person) -Apply (meaning a person can apply to join as a delivery person). You can do a simple application like my sample run or make it a more complicated process -Exit -You can pick any two options from Chipotle to order (I chose a burrito or bowl) -You should have at least three options for the user to pick from (with each option having at least two items to select-see sample run) -The total made at the end of the program run (from delivery charges) should be output to screen and a file Possible Sample Run 1 (your program does not have to match the following exactly, but should have the same functionality): ~~Ronnie’s Delivery Service~~ -------------------------------------- Pick from the following menu: 1. Customer 2. Apply 3. Exit 1 ***Place your order*** Burrito or Bowl? burrito Price will be $6.75 -Pick: Tofu, Steak, Chicken Tofu, Chicken -Pick: Cilantro-Lime Brown, Cilantro-Lime White none -Pick: Queso, Sour Cream, Fresh Tomato Salsa Queso Confirm order (yes or no): Burrito: Tofu, Chicken, Queso Yes Ok, Serj will be delivering your order. Thank you. -------------------------------------- Pick from the following menu: 1. Customer 2. Apply 3. Exit 2 Enter your full name: Ontronik Khachaturian Newest delivery person: Ontronik -------------------------------------- Pick from the following menu: 1. Customer 2. Apply 3. Exit 3 Exiting… Total made: ___ //should also be output to file
solving by using c++ program
Explanation / Answer
#include <iostream>
#include<fstream>
using namespace std;
class deliv{
public:
string del(string pick){
ifstream f1;
f1.open("abc.txt");;
string delperson
while(!eol(f1)){
delperson=f1.in();
}
return delperson;
}
};
class order{
public:
void ordercust(){
int d;
int price=0;
cout << "1.customer!" << endl;
cout << "2.apply!" << endl;
cout << "3.exit!" << endl;
cin>>d;
switch(d){
case 1:
int d1;
cout << "1.Burrito" << endl;
cout << "2.bowl!" << endl;
cout << "3.chicken" << endl;
cin>>d1;
switch(d1){
case 1: cout<<"price of burrito is $25 "<<endl;
cout<<"pick ";
string pick;
cout << "1.tofu" << endl;
cout << "2.steak" << endl;
cout << "3.chicken tofu" << endl;
cin>>pick;
if(pick=="tofu"){
price=50+25;
}
else{
if(pick=="steak"){
price=50+20;
}
else{
if(pick=="chicken tofu"){
price=50+30;
}
}
}
deliv d;
string p=d.del(pick);
cout<<"del person is "<<p<<endl;
break;
case 2:
cout<<"price of bowl is $15 "<<endl;
cout<<"pick ";
string pick;
cout << "1.takos" << endl;
cout << "2.salad" << endl;
cout << "3.corn" << endl;
cin>>pick;
if(pick=="takos"){
price=50+25;
}
else{
if(pick=="salad"){
price=50+20;
}
else{
if(pick=="corn"){
price=50+30;
}
}
}
deliv d;
string p=d.del(pick);
cout<<"del person is "<<p<<endl;
break;
case 3:
cout<<"price of chicken is $40 "<<endl;
cout<<"pick ";
string pick;
cout << "1.carnitas" << endl;
cout << "2.barbacoa" << endl;
cout << "3.softritas" << endl;
cin>>pick;
if(pick=="carnitas"){
price=50+25;
}
else{
if(pick=="barbacoa"){
price=50+20;
}
else{
if(pick=="softri"){
price=50+30;
}
}
}
deliv d;
string p=d.del(pick);
cout<<"del person is "<<p<<endl;
break;
}
break;
case 2:
cout<<endl<<"enter full name "<<endl;
string delp;
getline(delp,100);
cout<<"newest deleivery person - "<<delp<<endl;
break;
case 3:
cout<<"total expenditure is "<<price<<endl;
break;
}
}
};
int main()
{
order o;
o.ordercust();
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.