Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- void doc (float amount, int cash, int change);
- void info();
- int main ()
- {
- float st1 = 0, st2 = 0, st3 = 0, st4 = 0, st5 = 0;
- int q1 = 0, q2 = 0, q3 = 0, q4 = 0, q5 = 0;
- int order;
- float amount = 0, cash = 0, change = 0;
- // PRICES
- double a1 = 45.00, a2 = 50.00, a3 = 55.00, a4 = 99.00, a5 = 99.00;
- string m1 = "Regular Crispy Fries & Vanilla Cone Twirl";
- string m2 = "Spaghetti w/ Regular Iced Tea";
- string m3 = "Burger Steak w/ Regular Iced Tea";
- string m4 = "Fried Chicken w/ Regular Fries & Regular Iced Tea";
- string m5 = "Fried Chicken w/ Macaroni Soup & Regular Iced Tea ";
- fstream my;
- my.open("receipt.doc", ios::app | ios::in | ios::out );
- here:
- do
- {
- system("cls");
- cout << "\t\t-------------------------------------------" << endl;
- cout << "\t\t||---------------------------------------||" << endl;
- cout << "\t\t|| WELCOME TO ORDERING SYSTEM ||" << endl;
- cout << "\t\t||---------------------------------------||" << endl;
- cout << "\t\t-------------------------------------------" << endl;
- cout << endl;
- cout << "-------------------------------- M E N U -------------------------------" << endl;
- cout << "|| ||" << endl;
- cout << "|| 1. Regular Crispy Fries & Vanilla Cone Twirl = 45.00 PHP ||" << endl;
- cout << "|| 2. Spaghetti w/ Regular Iced Tea = 50.00 PHP ||" << endl;
- cout << "|| 3. Burger Steak w/ Regular Iced Tea = 55.00 PHP ||" << endl;
- cout << "|| 4. Fried Chicken w/ Regular Fries & Regular Iced Tea = 99.00 PHP ||" << endl;
- cout << "|| 5. Fried Chicken w/ Macaroni Soup & Regular Iced Tea = 99.00 PHP ||" << endl;
- cout << "|| 6. DONE! ||" << endl;
- cout << "------------------------------------------------------------------------" << endl;
- amount = st1 + st2+ st3 + st4 + st5;
- cout << "|| Your total amount = P "<< amount << " ||" << endl;
- cout << "------------------------------------------------------------------------" << endl;
- cout << endl << endl;
- cout << "View Info: Enter 0" << endl;
- cout << endl << "Hello there!, Welcome to Chicks' Resto! What is your order? ";
- cin >> order;
- cout << "\n";
- switch (order)
- {
- case 0:
- system ("PAUSE");
- system ("CLS");
- info();
- system ("PAUSE");
- system ("CLS");
- goto here;
- break;
- case 1:
- cout << "How many orders? \n";
- cin >> q1;
- cout << endl;
- cout << "\nYou Order " << q1 << " meal/s of Regular Crispy Fries & Vanilla Cone Twirl = " << a1 <<" PESOS" << endl;
- cout << endl;
- st1 = q1 * a1;
- cout << "Your total expense is: "<< st1 <<" PESOS"<<endl;
- cout << endl;
- break;
- case 2:
- cout << "How many orders? \n";
- cin >>q2;
- cout << endl;
- cout << "You Order " << q2 << " meal/s of Spaghetti w/ Regular Iced Tea = " << a2 <<" PESOS" <<endl;
- cout << endl;
- st2 = q2 * a2;
- cout << "Your total expense is: "<< st2 <<" PESOS"<<endl;
- cout << endl;
- break;
- case 3:
- cout << "How many orders? \n";
- cin >>q3;
- cout << endl;
- cout << "You Order " << q3 << " meal/s of Burger Steak w/ Regular Iced Tea = "<< a3 <<" PESOS"<<endl;
- cout << endl;
- st3 = q3 * a3;
- cout << "Your total expense is: "<< st3 <<" PESOS"<<endl;
- cout << endl;
- break;
- case 4:
- cout << "How many orders? \n";
- cin >>q4;
- cout << endl;
- cout << "You Order " << q4 << " meal/s of Fried Chicken w/ Regular Fries & Regular Iced Tea = "<< a4 <<" PESOS"<<endl;
- cout << endl;
- st4 = q4 * a4;
- cout << "Your total expense is: "<< st4 <<" PESOS"<<endl;
- cout << endl;
- break;
- case 5:
- cout << "How many orders? \n";
- cin >>q5;
- cout << endl;
- cout << "You Order " << q5 << " meal/s of Fried Chicken w/ Macaroni Soup & Regular Iced Tea = "<< a5 <<" PESOS"<<endl;
- cout << endl;
- st5 = q5 * a5;
- cout << "Your total expense is: "<< st5<<" PESOS"<<endl;
- cout << endl;
- break;
- case 6:
- cout<<"\nTotal cash: P";
- cin>>cash;
- if(cash < amount)
- {
- do
- {
- cout << endl;
- cout << "ERROR!! Please Add Cash\n";
- system ("pause");
- system ("cls");
- amount = st1 + st2 + st3 + st4 + st5;
- cout << "\nYour total amount is P" << amount;
- cout << "\n\n";
- cout << "Cash: ";
- cin >> cash;
- } while(cash < amount);
- }
- change = cash - amount;
- cout << "Your change will be P" << change;
- cout << "\n\nThank you for ordering!, please come again soon! ??";
- cout << "\n\n";
- string line="*****************************************";
- string msg =" Chiks' FastMeal Resto";
- my << "\n\n";
- my << line << endl;
- my << msg << endl;
- my << endl;
- my << "Cashier Name: Group 3\n\n";
- if (st1 > 0 ){
- my << m1 << q1 << " pc./s " << st1 << ".0 Php" << endl;
- }
- if (st2 > 0 ){
- my << m2 << q2 << " pc./s " << st2 << ".0 Php" << endl;
- }
- if (st3 > 0 ){
- my << m3 << q3 <<" pc./s " << st3 << ".0 Php" << endl;
- }
- if (st4 > 0 ){
- my << m4 << q4 << " pc./s " << st4 << ".0 Php" << endl;
- }
- if (st5 > 0 ){
- my << m5 << q5 << " pc./s " << st5 << ".0 Php" << endl;
- }
- my << "\n\n";
- my << "Total: "<< amount <<".0 Php"<< endl;
- my << "Cash: "<< cash << ".0 Php" << endl;
- my << "Change: "<< change << ".0 Php" << endl << endl << endl;
- my << "THANK YOU! COME AGAIN!\n";
- my << line << endl;
- st1 = 0, st2 = 0, st3 = 0, st4 = 0, st5 = 0;
- q1 = 0, q2 = 0, q3 = 0, q4 = 0, q5 = 0;
- amount = 0;
- cash = 0;
- change = 0;
- system ("pause");
- }
- }
- while (order != 0);
- my.close();
- return 0;
- }
- void info()
- {
- cout << "-------------------------------------------------------" << endl;
- cout << "||---------------------------------------------------||" << endl;
- cout << "|| SIMPLE C++ SYSTEM PROGRAM ||" << endl;
- cout << "||---------------------------------------------------||" << endl;
- cout << "|| Section: || Subject: || Schedule: ||" << endl;
- cout << "|| BSINT-A || Com. Prog. 2 || 8:30-10:00 AM (TTH) ||" << endl;
- cout << "||---------------------------------------------------||" << endl;
- cout << "-------------------------------------------------------" << endl;
- cout << endl;
- cout << "-------------------------------------------------------" << endl;
- cout << "|| MEMBERS ||" << endl;
- cout << "-------------------------------------------------------" << endl;
- cout << endl;
- cout << "-------------------------------------------------------" << endl;
- cout << "|| ||" << endl;
- cout << "|| CALABROSO, TEDDY GLENBOY ||" << endl;
- cout << "|| ||" << endl;
- cout << "|| CARVAJAL, CHRISTIAN FRANC ||" << endl;
- cout << "|| ||" << endl;
- cout << "|| CRISOSTOMO, CARMELA JANE ||" << endl;
- cout << "|| ||" << endl;
- cout << "|| DESCALLAR, MARIELE ||" << endl;
- cout << "|| ||" << endl;
- cout << "|| EJERCITO, AHLLYSA ||" << endl;
- cout << "|| ||" << endl;
- cout << "|| ETOM, DARYL ANTHONY ||" << endl;
- cout << "|| ||" << endl;
- cout << "|| GELE, NIñA LYNN ||" << endl;
- cout << "|| ||" << endl;
- cout << "-------------------------------------------------------" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement