-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcar_parking.cpp
92 lines (88 loc) · 2.67 KB
/
car_parking.cpp
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
90
91
92
#include<iostream>
using namespace std;
int main(){
int rickshaw=0,car=0,bike=0,bus=0;
int count=0,amount=0;
int x,y;
while(true){
cout<<"press 1 for bike..."<<endl;
cout<<"press 2 for rickshaw..."<<endl;
cout<<"press 3 for car..."<<endl;
cout<<"press 4 for bus..."<<endl;
cout<<"press 5 for total entries..."<<endl;
cout<<"press 6 for Delete all entries..."<<endl;
cin>>x;
if (x==1)
{
if (count<=50)
{
bike++;
amount = amount + 50;
count = count + 1;
cout<<"Welcome.."<<endl<<endl;
}
else{
cout<<"Sorry,Parking is full..!!"<<endl;
}
}
else if(x==2){
if (count<=50)
{
rickshaw++;
amount = amount + 100;
count = count + 1;
cout<<"Welcome.."<<endl<<endl;
}
else{
cout<<"Sorry,Parking is full..!!"<<endl;
}
}
else if(x==3){
if (count<=50)
{
car++;
amount = amount + 200;
count = count + 1;
cout<<"Welcome.."<<endl<<endl;
}
else{
cout<<"Sorry,Parking is full..!!"<<endl;
}
}
else if(x==4){
if (count<=50)
{
bus++;
amount = amount + 300;
count = count + 1;
cout<<"Welcome.."<<endl<<endl;
}
else{
cout<<"Sorry,Parking is full..!!"<<endl;
}
}
else if(x==5){
cout<<"**************************************"<<endl;
cout<<"total vehicals in parking : "<<count<<endl;
cout<<"total cash collect : "<<amount<<endl;
cout<<"total bikes in parking : "<<bike<<endl;
cout<<"total rickshaw in parking : "<<rickshaw<<endl;
cout<<"total cars in parking : "<<car<<endl;
cout<<"total buses in parking : "<<bus<<endl;
y = 50 - count;
cout<<"Remaining empty place are : "<<y<<endl;
cout<<"**************************************"<<endl<<endl;
}
else if(x==6){
count=0;
amount=0;
bike=0;
rickshaw=0;
car=0;
bus=0;
cout<<"**************************************"<<endl;
cout<<"Entry book is empty.."<<endl;
cout<<"**************************************"<<endl<<endl;
}
}
}