What's new

Help Source Code for Simple Ordering System C++

PHC Liebe

Honorary Poster
Established
Joined
Apr 4, 2020
Posts
132
Reaction
53
Points
132
Patulong po san sa codes

IMG_20220123_155643.jpg
IMG_20220123_155626.jpg
IMG_20220123_155558.jpg

ito na po na simulan ko

#include <iostream>
using namespace std;

int main()
{
string order;
int total,cr,ac;
char cashier[30];
int Total;

float a1 = 121.50 ,A1=0;
float a2 = 121.25 ,A2=0;
float a3 = 94.75 ,A3=0;
float a4 = 66.80 ,A4=0;

float b1 = 439.65 , B1=0;
float b2 = 539.75 , B2=0;
float b3 = 286.50 , B3=0;
float b4 = 825.90 , B4=0;

float c1 = 182.65 ,C1=0;
float c2 = 182.85 ,C2=0;
float c3 = 109.55 ,C3=0;

float d1 = 193.60 , D1=0;
float d2 = 39.50 , D2=0;
float d3 = 59.55 , D3=0;
float d4 = 208.68 , D4=0;
float d5 = 127.38 , D5=0;

float e1 = 105.35 , E1=0;
float e2 = 109.55 , E2=0;
float e3 = 108.65 , E3=0;
float e4 = 55.60 , E4=0;

float f1 = 143.65 , F1=0;
float f2 = 50.55 , F2=0;
float f3 = 55.65 , F3=0;
float f4 = 52.85 , F4=0;

float g1 = 61.00 , G1=0;
float g2 = 50.00 , G2=0;
float g3 = 52.00 , G3=0;
float g4 = 54.00 , G4=0;
float g5 = 53.00 , G5=0;
float g6 = 62.00 , G6=0;
float g7 = 42.00 , G7=0;
float g8 = 39.00 , G8=0;
float g9 = 44.00 , G9=0;

int a1A1=0, a2A2=0, a3A3=0, a4A4=0, b1B1=0, b2B2=0, b3B3=0, b4B4=0, c1C1=0, c2C2=0, c3C3=0, d1D1=0, d2D2=0, d3D3=0, d4D4=0, d5D5=0, e1E1=0, e2E2=0, e3E3=0, e4E4=0, f1F1=0, f2F2=0, f3F3=0, f4F4=0, g1G1=0, g2G2=0, g3G3=0, g4G4=0, g5G5=0, g6G6=0, g7G7=0, g8G8=0, g9G9=0;
int aaa=0,bbb=0,ccc=0,ddd=0,eee=0,fff=0,ggg=0;



cout<<"=================================================="<<endl;
cout<<"Menu\t\t\t\t\t Prices"<<endl;
cout<<"=================================================="<<endl;
cout<<"Breakfast"<<endl;
cout<<" A1 Beef Tapa\t\t\t\tP 121.50"<<endl;
cout<<" A2 Corned Beef\t\t\t\tP 121.25"<<endl;
cout<<" A3 Breakfast Burger Steak\t\tP 94.75" <<endl;
cout<<" A4 Breakfast Shanghai\t\t\tP 66.80"<<endl;
cout<<"Familymeals"<<endl;
cout<<" B1 6-pc Chickenjoy Solo\t\tP 439.65"<<endl;
cout<<" B2 8-pc Chickenjoy Solo\t\tP 539.75"<<endl;
cout<<" B3 6-pc Burger Steak Family Pan\tP 286.50"<<endl;
cout<<" B4 Honey Beef Rice Family Pan\t\tP 825.90"<<endl;
cout<<"Chicken Joy"<<endl;
cout<<" C1 1-pc Chicken Joy with Burger Steak\tP 182.65"<<endl;
cout<<" C2 1-pc Chicken Joy with Shanghai\tP 182.85"<<endl;
cout<<" C3 1-pc Chicken Joy with Spaghetti\tP 109.55"<<endl;
cout<<"Burgers"<<endl;
cout<<" D1 Spicy Champ\t\t\t\tP 193.60"<<endl;
cout<<" D2 Yumburger\t\t\t\tP 39.50"<<endl;
cout<<" D3 Cheesy Yumburger\t\t\tP 59.55"<<endl;
cout<<" D4 Bacon Champ\t\t\t\tP 208.68"<<endl;
cout<<" D5 Pork-Free Aloha Champ\t\tP 127.38"<<endl;
cout<<"Jolly Spaghetti"<<endl;
cout<<" E1 Jolly Spaghetti with Yumburger\tP 105.35"<<endl;
cout<<" E2 Jolly Spaghetti with Burger Steak\tP 109.55"<<endl;
cout<<" E3 Jolly Spaghetti with Shanghai\tP 108.65"<<endl;
cout<<" E4 Jolly Spaghetti\t\t\tP 55.60"<<endl;
cout<<"Sandwiches and Pies"<<endl;
cout<<" F1 Chickenwich\t\t\t\tP 143.65"<<endl;
cout<<" F2 Tuna Pie\t\t\t\tP 50.55"<<endl;
cout<<" F3 Cheesy Classic Jolly Hotdog\t\tP 55.65"<<endl;
cout<<" F4 Regular Jolly Hotdog\t\tP 52.85"<<endl;
cout<<"Beverages"<<endl;
cout<<" G1 Iced Tea\t\t\t\tP 61.00"<<endl;
cout<<" G2 Coke\t\t\t\tP 50.00"<<endl;
cout<<" G3 Sprite\t\t\t\tP 52.00"<<endl;
cout<<" G4 Royal\t\t\t\tP 54.00"<<endl;
cout<<" G5 Sarsi\t\t\t\tP 53.00"<<endl;
cout<<" G6 Pineapple Juice\t\t\tP 62.00"<<endl;
cout<<" G7 Soda Float\t\t\t\tP 42.00"<<endl;
cout<<" G8 Coffee\t\t\t\tP 39.00"<<endl;
cout<<" G9 Hot Chocolate\t\t\tP 44.00"<<endl;

cout<<"End Transaction"<<endl;
cout<<"H1 Billout"<<endl;
cout<<"=================================================="<<endl;
cout<<endl;
do
{
cout<<"Item Codes(A1-H1): ";
cin>>order;


if(order == "A1")
{
cout<<"Quantity: ";
cin>>A1;

a1A1=a1*A1;
aaa++;
}
else

if(order == "A2")
{
cout<<"Quantity: ";
cin>>A2;

a2A2=a2*A2;
aaa++;
}
else

if(order == "A3")
{
cout<<"Quantity: ";
cin>>A3;

a3A3=a3*A3;
aaa++;
}
else

if(order == "A4")
{
cout<<"Quantity: ";
cin>>A4;

a4A4=a4*A4;
aaa++;
}
else

if (order == "B1")
{
cout<<"Quantity: ";
cin>>B1;

b1B1=b1*B1;
bbb++;
}
else

if (order == "B2")
{
cout<<"Quantity: ";
cin>>B2;

b2B2=b2*B2;
bbb++;
}
else

if (order == "B3")
{
cout<<"Quantity: ";
cin>>B3;

b3B3=b3*B3;
bbb++;
}
else

if (order == "B4")
{
cout<<"Quantity: ";
cin>>B4;

b4B4=b4*B4;
bbb++;
}
else

if (order == "C1")
{
cout<<"Quantity: ";
cin>>C1;

c1C1=c1*C1;
ccc++;
}
else

if (order == "C2")
{
cout<<"Quantity: ";
cin>>C2;

c2C2=c2*C2;
ccc++;
}
else

if (order == "C3")
{
cout<<"Quantity: ";
cin>>C3;

c3C3=c3*C3;
ccc++;
}
else

if(order == "D1")
{
cout<<"Quantity: ";
cin>>D1;

d1D1=d1*D1;
ddd++;
}
else

if(order == "D2")
{
cout<<"Quantity: ";
cin>>D2;

d2D2=d2*D2;
ddd++;
}
else

if(order == "D3")
{
cout<<"Quantity: ";
cin>>D3;

d3D3=d3*D3;
ddd++;
}
else

if(order == "D4")
{
cout<<"Quantity: ";
cin>>D4;

d4D4=d4*D4;
ddd++;
}
else

if(order == "D5")
{
cout<<"Quantity: ";
cin>>D5;

d5D5=d5*D5;
ddd++;
}
else

if(order == "E1")
{
cout<<"Quantity: ";
cin>>E1;

e1E1=e1*E1;
eee++;
}
else

if(order == "E2")
{
cout<<"Quantity: ";
cin>>E2;

e2E2=e2*E2;
eee++;
}
else

if(order == "E3")
{
cout<<"Quantity: ";
cin>>E3;

e3E3=e3*E3;
eee++;
}
else

if(order == "E4")
{
cout<<"Quantity: ";
cin>>E4;

e4E4=e4*E4;
eee++;
}
else

if(order == "F1")
{
cout<<"Quantity: ";
cin>>F1;

f1F1=f1*F1;
fff++;
}
else

if(order == "F2")
{
cout<<"Quantity: ";
cin>>F2;

f2F2=f2*F2;
fff++;
}
else

if(order == "F3")
{
cout<<"Quantity: ";
cin>>F3;

f3F3=f3*F3;
fff++;
}
else

if(order == "F4")
{
cout<<"Quantity: ";
cin>>F4;

f4F4=f4*F4;
fff++;
}
else

if(order == "G1")
{
cout<<"Quantity: ";
cin>>G1;

g1G1=g1*G1;
ggg++;
}
else

if(order == "G2")
{
cout<<"Quantity: ";
cin>>G2;

g2G2 =g2*G2;
ggg++;
}
else

if(order == "G3")
{
cout<<"Quantity: ";
cin>>G3;

g3G3=g3*G3;
ggg++;
}
else

if(order == "G4")
{
cout<<"Quantity: ";
cin>>G4;

g4G4=g4*G4;
ggg++;
}
else

if(order == "G5")
{
cout<<"Quantity: ";
cin>>G5;

g5G5=g5*G5;
ggg++;
}
else

if(order == "G6")
{
cout<<"Quantity: ";
cin>>G6;

g6G6=g6*G6;
ggg++;
}
else

if(order == "G7")
{
cout<<"Quantity: ";
cin>>G7;

g7G7=g7*G7;
ggg++;
}
else

if(order == "G8")
{
cout<<"Quantity: ";
cin>>G8;

g8G8=g8*G8;
ggg++;
}
else

if(order == "G9")
{
cout<<"Quantity: ";
cin>>G9;

g9G9=g9*G9;
ggg++;
}


}while(order != "H1");




cout<<endl;
cout<<"=================================================="<<endl;
cout<<"OFFICIAL RECEIPT"<<endl;



cout<<endl;

if(aaa > 0)
{
cout<<A1<<" Fried chicken: "<<a1A1<<endl;}
if(aaa > 0)
{
cout<<A2<<" Fried chicken: "<<a2A2<<endl;}
if(aaa > 0)
{
cout<<A3<<" Fried chicken: "<<a3A3<<endl;}
if(aaa > 0)
{
cout<<A4<<" Fried chicken: "<<a4A4<<endl;}
if(bbb > 0)
{
cout<<B1<<" Hamburger: "<<b1B1<<endl;
}
if(bbb > 0)
{
cout<<B2<<" Hamburger: "<<b2B2<<endl;
}
if(bbb > 0)
{
cout<<B3<<" Hamburger: "<<b3B3<<endl;
}
if(bbb > 0)
{
cout<<B4<<" Hamburger: "<<b4B4<<endl;
}
if(ccc > 0)
{
cout<<C1<<" Spaghetti: "<<c1C1<<endl;
}
if(ccc > 0)
{
cout<<C2<<" Spaghetti: "<<c2C2<<endl;
}
if(ccc > 0)
{
cout<<C3<<" Spaghetti: "<<c3C3<<endl;
}
if(ddd > 0)
{
cout<<D1<<"x Lemon Juice: "<<d1D1<<endl;
}
if(ddd > 0)
{
cout<<D2<<"x Lemon Juice: "<<d2D2<<endl;
}
if(ddd > 0)
{
cout<<D3<<"x Lemon Juice: "<<d3D3<<endl;
}
if(ddd > 0)
{
cout<<D4<<"x Lemon Juice: "<<d4D4<<endl;
}
if(ddd > 0)
{
cout<<D5<<"x Lemon Juice: "<<d5D5<<endl;
}
if(eee > 0)
{
cout<<E1<<"x Mango Shake: "<<e1E1<<endl;
}
if(eee > 0)
{
cout<<E2<<"x Mango Shake: "<<e2E2<<endl;
}
if(eee > 0)
{
cout<<E3<<"x Mango Shake: "<<e3E3<<endl;
}
if(eee > 0)
{
cout<<E4<<"x Mango Shake: "<<e4E4<<endl;
}
if(fff > 0)
{
cout<<F1<<"x Coke: "<<f1F1<<endl;
}
if(fff > 0)
{
cout<<F2<<"x Coke: "<<f2F2<<endl;
}
if(fff > 0)
{
cout<<F3<<"x Coke: "<<f3F3<<endl;
}
if(fff > 0)
{
cout<<F4<<"x Coke: "<<f4F4<<endl;
}
if(ggg > 0)
{
cout<<G1<<"x Coke: "<<g1G1<<endl;
}
if(ggg > 0)
{
cout<<G2<<"x Coke: "<<g2G2<<endl;
}
if(ggg > 0)
{
cout<<G3<<"x Coke: "<<g3G3<<endl;
}
if(ggg > 0)
{
cout<<G4<<"x Coke: "<<g4G4<<endl;
}
if(ggg > 0)
{
cout<<G5<<"x Coke: "<<g5G5<<endl;
}
if(ggg > 0)
{
cout<<G6<<"x Coke: "<<g6G6<<endl;
}
if(ggg > 0)
{
cout<<G7<<"x Coke: "<<g7G7<<endl;
}
if(ggg > 0)
{
cout<<G8<<"x Coke: "<<g8G8<<endl;
}
if(ggg > 0)
{
cout<<G9<<"x Coke: "<<g9G9<<endl;
}

total=a1A1+a2A2+a3A3+a4A4+b1B1+b2B2+b3B3+b4B4+c1C1+c2C2+c3C3+d1D1+d2D2+d3D3+d4D4+d5D5+e1E1+e2E2+e3E3+e4E4+f1F1+f2F2+f3F3+f4F4+g1G1+g2G2+g3G3+g4G4+g5G5+g6G6+g7G7+g8G8+g9G9;

cout<<endl;

cout<<"Total: "<<total<<endl;
cout<<"Cash recieved: ";
cin>>cr;
cout<<endl;
do
{
if(cr >= total)
{ /* terminate */ }
else
{
cout<<"Cash not enough need: "<<total-cr<<" more!"<<endl;

cout<<"Additional cash recieved: ";
cin>>ac;

cr = cr + ac;

}

}while(cr < total);

cout<<"=============== RECEIPT =============="<<endl;
cout<<endl;

cout<<"Cashier: "<<cashier<<endl;

cout<<endl;

if(aaa > 0)
{
cout<<A1<<"x Fried chicken: "<<a1A1<<endl;
}
if(aaa > 0)
{
cout<<A2<<"x Fried chicken: "<<a2A2<<endl;
}
if(aaa > 0)
{
cout<<A3<<"x Fried chicken: "<<a3A3<<endl;
}
if(aaa > 0)
{
cout<<A4<<"x Fried chicken: "<<a4A4<<endl;
}
if(bbb > 0)
{
cout<<B1<<"x Hamburger: "<<b1B1<<endl;
}
if(bbb > 0)
{
cout<<B2<<"x Hamburger: "<<b2B2<<endl;
}
if(bbb > 0)
{
cout<<B3<<"x Hamburger: "<<b3B3<<endl;
}
if(bbb > 0)
{
cout<<B4<<"x Hamburger: "<<b4B4<<endl;
}
if(ccc > 0)
{
cout<<C1<<"x Spaghetti: "<<c1C1<<endl;
}
if(ccc > 0)
{
cout<<C2<<"x Spaghetti: "<<c2C2<<endl;
}
if(ccc > 0)
{
cout<<C3<<"x Spaghetti: "<<c3C3<<endl;
}
if(ddd > 0)
{
cout<<"Lemon Juice: "<<d1D1<<endl;
}
if(ddd > 0)
{
cout<<"Lemon Juice: "<<d2D2<<endl;
}
if(ddd > 0)
{
cout<<"Lemon Juice: "<<d3D3<<endl;
}
if(ddd > 0)
{
cout<<"Lemon Juice: "<<d4D4<<endl;
}
if(ddd > 0)
{
cout<<"Lemon Juice: "<<d5D5<<endl;
}
if(eee > 0)
{
cout<<"Mango Shake: "<<e1E1<<endl;
}
if(eee > 0)
{
cout<<"Mango Shake: "<<e2E2<<endl;
}
if(eee > 0)
{
cout<<"Mango Shake: "<<e3E3<<endl;
}
if(eee > 0)
{
cout<<"Mango Shake: "<<e4E4<<endl;
}
if(fff > 0)
{
cout<<"Coke: "<<f1F1<<endl;
}
if(fff > 0)
{
cout<<"Coke: "<<f2F2<<endl;
}
if(fff > 0)
{
cout<<"Coke: "<<f3F3<<endl;
}
if(fff > 0)
{
cout<<"Coke: "<<f4F4<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g1G1<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g2G2<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g3G3<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g4G4<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g5G5<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g6G6<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g7G7<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g8G8<<endl;
}
if(ggg > 0)
{
cout<<"Coke: "<<g9G9<<endl;
}
cout<<endl;

cout<<"Total Amount............. "<<total<<endl;
cout<<"Cash Recieved........... "<<cr<<endl;
cout<<endl;
cout<<"Change...................... "<< cr-total<<endl;

cout<<endl;

return 0;
}
 

Attachments

Back
Top