-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoding for parking.cpp
More file actions
89 lines (76 loc) · 1.78 KB
/
Copy pathcoding for parking.cpp
File metadata and controls
89 lines (76 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <iostream>
using namespace std;
int main()
{
int u_input;
int amount=0, count=0;
int c=0;
int b=0;
int r=0;
//menu
while (true)
{
cout << "press 1 for rickshaw: " << r << endl;
cout << "press 2 for car: " << c << endl;
cout << "press 3 for bus: " << b << endl;
cout << "press 4 to show record: "<< endl;
cout << "press 5 to delete record: " << endl;
cin >> u_input;
if(u_input==1)
{
if (count<=50)
{
r++;
amount = amount + 100;
count = count +1;
}
else
cout << "No more cars, parking is full" << endl;
}
else if(u_input==2)
{
if(count <=50) {
c++;
amount =amount +200;
count =count +1;
}
else
cout << "No more cars, parking is full" << endl;
}
else if (u_input == 3)
{
if(count <=50)
{
b++;
amount= amount +300;
count = count + 1;}
else
cout << "No more cars, parking is full" << endl;
}
else if (u_input ==4)
{
cout << "************************************************"<<endl;
cout << "total amount: Rs" << amount << endl;
cout << "total number of vehicles pakrked: "<< count << endl;
cout << "total number of cars pakrked: "<< c << endl;
cout << "total number of rickshaws pakrked: " << r << endl;
cout << "total number of buses pakrked: " << b << endl;
cout << "************************************************"<<endl;
}
else if (u_input ==5)
{
amount = 0;
count = 0;
cout << "*********************************" <<endl;
cout << "R E C O R D D E L E T E D" << endl;
cout << "*********************************" << endl;
r=0;
c=0;
b=0;
}
else {
cout << "invlalid operator" << endl;
}
}
return 0;
}