-
Notifications
You must be signed in to change notification settings - Fork 0
/
car_rental_system.cpp
76 lines (67 loc) · 1.22 KB
/
car_rental_system.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
// remove search from car_list
#include <iostream>
#include <string>
#include <cstdlib>
#include <fstream>
//#include "car_add.cpp"
//#include "payment.cpp"
//#include "wagon.cpp"
//dfd
#include "CarList.cpp"
using namespace std;
class Car_Rental_System
{
private:
CarList *list;
int usertype;
public:
void setUserType(int usertype)
{
this->usertype = usertype;
}
void search()
{
list->display();
}
};
int main()
{
Car_Rental_System customer;
cout << "Enter the user type 0 if you want to give the car. Else enter the usertype 1 to take a car " << endl;
int x;
cin >> x;
customer.setUserType(x);
switch (x)
{
case 0:
{
CarList obj;
obj.add();
}
break;
case 1:
customer.search();
break;
default:
cout << "Wrong choice" << endl;
}
/*cout<<"if you want to search write yes else write no: "<<endl;
string choice;
cin>>choice;
if(choice=="yes")
{
customer.search();
}
else
return 0;*/
/*cout<<"if you. want to search write yes else write no: "<<endl;
string choice;
cin>>choice;
if(choice=="yes")
{
customer.search();
}
else
return 0;*/
return 0;
}