Sei sulla pagina 1di 3

Q# 4. Point of sale terminal.

1: #include<iostream>
2: using namespace std;
3: int main(){
4: int cat,choice,n,total=0,count=0;
5: long cost;
6: char ch,decision;
7: cout<<" Sports Shop"<<endl;
8: cout<<" Main Menu"<<endl;
9: cout<<" 1. Uniforms"<<endl;
10: cout<<" 2. Balls"<<endl;
11: cout<<" 3. Bats"<<endl;
12: cout<<" 4. Reckits"<<endl;
13: do
14: {
15: cout<<"choose your catagory: ";
16: cin>>cat;
17: switch(cat){
18: case 1:
19: cout<<"1. Uniform"<<endl;
20: cout<<" 1. Cricke Uniform Rs.500"<<endl;
21: cout<<" 2. Footbal Uniform Rs.600"<<endl;
22: cout<<" 3. Badminton Uniform Rs.550"<<endl;
23: cout<<"Choose your choice: ";
24: cin>>choice;
25: switch(choice){
26: case 1:
27: cout<<"How many quantities you want to buy? ";
28: cin>>n;
29: cost=n*500;
30: break;
31: case 2:
32: cout<<"How many quantities you want to buy? ";
33: cin>>n;
34: cost=n*600;
35: break;
36: case 3:
37: cout<<"How many quantities you want to buy? ";
38: cin>>n;
39: cost=n*550;
40: break;
41: }
42: break;
43: case 2:
44: cout<<"2. Balls"<<endl;
45: cout<<" 1. Baseball Rs.50"<<endl;
46: cout<<" 2. Tannis Ball Rs.70"<<endl;
47: cout<<" 3. Hard Ball Rs.100"<<endl;
48: cout<<"choose your choice: ";
49: cin>>choice;
50: switch(choice){
51: case 1:
52: cout<<"How many quantities you want to buy? ";
53: cin>>n;
54: cost=n*50;
55: break;
56: case 2:
57: cout<<"How many quantities you want to buy? ";
58: cin>>n;
59: cost=n*70;
60: break;
61: case 3:
62: cout<<"How many quantities you want to buy? ";
63: cin>>n;
64: cost=n*100;
65: break;
66: }
67: break;
68: case 3:
69: cout<<"3. Bats"<<endl;
70: cout<<" 1. Baseball Bat Rs.1500"<<endl;
71: cout<<" 2. Cricket Bat Rs.3000"<<endl;
72: cout<<"choose your choice: ";
73: cin>>choice;
74: switch(choice){
75: case 1:
76: cout<<"How many quantities you want to buy? ";
77: cin>>n;
78: cost=1500*n;
79: break;
80: case 2:
81: cout<<"How many quantities you want to buy? ";
82: cin>>n;
83: cost=3000*n;
84: break;
85: }
86: break;
87: case 4:
88: cout<<"4. Reckits"<<endl;
89: cout<<" 1. Normal Reckits Rs.300"<<endl;
90: cout<<" 2. Adidas Reckits Rs.700"<<endl;
91: cout<<" 3. Imported Reckits Rs.900"<<endl;
92: cout<<"choose your choice: ";
93: cin>>choice;
94: switch(choice){
95: case 1:
96: cout<<"How many quantities you want to buy? ";
97: cin>>n;
98: cost=300*n;
99: break;
100: case 2:
101: cout<<"How many quantities you want to buy? ";
102: cin>>n;
103: cost=700*n;
104: break;
105: case 3:
106: cout<<"How many quantities you want to buy? ";
107: cin>>n;
108: cost=900*n;
109: break;
110: }
111: break;
112: }
113: total=total+cost;
114: count=count+n;
115: cout<<"press C want to continue or Q for quit. ";
116: cin>>ch;
117: }
118: while(ch=='c');
119: cout<<"total number of item purchased: "<<count<<endl;
120: cout<<"total amount is: "<<total;
121:
122: }

Potrebbero piacerti anche