Question

In: Computer Science

You has been requested to design and develop a food ordering system based on following requirements:...

You has been requested to design and develop a food ordering system based on following requirements:

The system shall allow the user to place an order for the food(s), view the food details, modify or delete the details of the food if necessary. Your program should be menu driven, giving the user various choices. You shall design the system by demonstrating the full understanding of object-oriented and use of list/link-list concept.

For every food order, the following information will be stored: Order ID (Auto assigned, unique ID), Food Code, flavor (example: Strawberry, chocolate), weight (Kg), Unit Price, Qty and customer information who order this cake. The customer information consists of customer ID, name, address and contact number. The order ID shall be automatically assigned with a unique ID when new order is added. The system shall display additional information that is amount (unit price * qty) when viewing the order details.

*in C++ language .

Solutions

Expert Solution

// I have implemented all the required fuctionality you can take the order and print the details even it // // //include total price I have given the code below if you get any trouble check the link for repl it below

// LINK : https://repl.it/@FAYAZPASHA/CreativeDefinitiveDebugging#main.cpp

#include<bits/stdc++.h>
using namespace std;

class CustomerDetails{
   public:
   //Customer
       string name = "";
       int customerId = 0;
       string address = "";
       long long int phone = 0;

   //Food
       int orderId = 0;
       string foodCode = "";
       string flavour = "";
       float weight = 0;
       float price = 0;
       int quantity = 0;
       float totalPrice = 0;

   CustomerDetails(){

   }

   CustomerDetails(string nam, int custid, string addr, long long int ph, int orid, string focode, string flr, float wei, float pri, int quan){
           name = nam;
           customerId = custid;
           address = addr;
           phone = ph;
           orderId = orid;
           foodCode = focode;
           flavour = flr;
           weight = wei;
           price = pri;
           quantity = quan;
           totalPrice = pri * quan;
   }
};

map<int, CustomerDetails> customers;

void placeOrder(){
   cout << "Enter the customer Details\n";
   int cusidd;

   string custname, addr;
   long long int ph;

   cout << "Enter the Customer Id: "; cin >> cusidd;

   cout << "Customer Name : "; cin >> custname;
   //cout << endl;
   cout << "Customer Address : "; cin >> addr;
   //cout << endl;
   cout << "Customer phone number : "; cin >> ph;
   //cout << endl;

   cout << "Enter the order Details\n";

   string foodcd;

   float wei;
   float pri;
   int quan;

   cout << "Enter the FOOD Code\n";
   cin >> foodcd;

   cout << "Choose the falvours\n";
   cout << "1 : Chocolate\n";
   cout << "2 : Strawberry\n";
   cout << "3 : Vanilla\n";
   cout << "4 : Mint Chocolate Chip\n";
   cout << "5 : Buttered Pecan\n";

   int frl_choice; cin >> frl_choice;
   string flr = "";
   if(frl_choice == 1) flr = "Chocolate";
   else if(frl_choice == 2) flr = "Strawberry";
   else if(frl_choice == 3) flr = "Vanilla";
   else if(frl_choice == 4) flr = "Mint Chocolate Chip";
   else if(frl_choice == 5) flr = "Buttered Pecan";


   cout << "How much Amount(kg) you need : "; cin >> wei;

   cout << "Fix the Price : "; cin >> pri;

   cout << "Enter the Quantity : "; cin >> quan;

   //ongoingOrderId++;

   CustomerDetails cust( custname, cusidd, addr, ph, cusidd, foodcd, flr, wei, pri, quan);
   //customers.insert({cusidd, cust});
   customers[cusidd] = cust;
}


void customerDetails(int id){

   if(customers.find(id) == customers.end()){
       cout << "Customer Id Does not Exist\n";
       return;
   }

   CustomerDetails cst = customers[id];


   cout << "           Customer Details are\n";
   cout << "****************************************\n";
   cout << "       Customer Id : " << cst.customerId << endl;
   cout << "       Customer Name : " << cst.name << endl;
   cout << "       Customer Phone : " << cst.phone << endl;
   cout << "       Customer Address : "<< cst.address << endl;

   cout << "       Food Code : " << cst.foodCode << endl;
   cout << "       Flavour : " << cst.flavour << endl;

   cout << "       Weight : " << cst.weight << "Kg" << endl;
   cout << "       Price : " << cst.price << "$ " << endl;
   cout << "       Quantity : " << cst.quantity << endl;

   cout << "****************************************\n";
   cout << "       Total Price = $ " << cst.totalPrice << endl;
}


int main(){
   customers.clear();
   cout << "---------WELCOME-------------\n";
   int choice;
   while(1){

       cout << "1 : Place Order\n";
       cout << "2 : Check for order details\n";

       cin >> choice;

       if(choice == 1){
               placeOrder();
       }
       else if(choice == 2){
           cout << "Enter the Customer Id\n";
           int id; cin >> id;
           customerDetails(id);
       }else if(choice == 0) break;
   }
   return 0;
}


Related Solutions

You has been requested to design and develop a food ordering system based on following requirements:...
You has been requested to design and develop a food ordering system based on following requirements: The system shall allow the user to place an order for the food(s), view the food details, modify or delete the details of the food if necessary. Your program should be menu driven, giving the user various choices. You shall design the system by demonstrating the full understanding of object-oriented and use of list/link-list concept. For every food order, the following information will be...
You has been requested to design and develop a food ordering system in C++ language based...
You has been requested to design and develop a food ordering system in C++ language based on following requirements: The system shall allow the user to place an order for the food(s), view the food details, modify or delete the details of the food if necessary. Your program should be menu driven, giving the user various choices. You shall design the system by demonstrating the full understanding of object-oriented and use of list/link-list concept. For every food order, the following...
As a supervisor, you have been requested to assist junior employees to develop a career development...
As a supervisor, you have been requested to assist junior employees to develop a career development action plan (CDAP). Highlight the key critical stages useful in preparing the plan.
The list of ALL nonfunctional requirements and ALL design constraints for the system? nonfunctional requirement based...
The list of ALL nonfunctional requirements and ALL design constraints for the system? nonfunctional requirement based on :Performance ,Reliability, Availability, Security,Maintainability and Portability Payroll Management System As the head of Information Technology at Mena, Inc., you are tasked with building a new payroll management system to replace the existing system which is hopelessly out of date. Mena needs a new system to allow employees to record timecard information electronically and automatically generate paychecks based on the number of hours worked...
You have been requested to design a schema (as an E/R diagram) for the contact-tracing database....
You have been requested to design a schema (as an E/R diagram) for the contact-tracing database. Your group is busy working to design and field a contact-tracing database to be able to trace rapidly people who may have been in close proximity (contact) to someone diagnosed with a highly infectious disease. The Contact Tracing Domain To be able to trace with whom a person has been in contact, we need to know where that person has been and when. We...
b.The lead engineer on the design team has requested that you match the reliability of the...
b.The lead engineer on the design team has requested that you match the reliability of the parallel system with a series system. All three of the valves in series will have the same probability of functioning correctly. What does this probability need to be to equal the probability of the parallel system? c. Comment on the advantages and disadvantages of using parallel systems in aircraft design. Based on the experimental data, it was determined that the probability of the three...
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based...
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based on client outcomes, scientific evidence and political inputs. How can an RN keep up their practice with the ever changing requirements?
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based...
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based on client outcomes, scientific evidence and political inputs. Discuss one law or regulation that directly impact the practice of the RN?
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based...
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based on client outcomes, scientific evidence and political inputs. Discuss one law or regulation that directly impact the practice of the RN? How can an RN keep up their practice with the ever changing requirements?
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based...
Regulation of healthcare has been subject to many rules, laws and requirements. Requirements continually change based on client outcomes, scientific evidence and political inputs. Discuss one law or regulation that directly impact the practice of the RN? How can an RN keep up their practice with the ever changing requirements?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT