-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathedom.cpp
More file actions
90 lines (85 loc) · 1.78 KB
/
Copy pathedom.cpp
File metadata and controls
90 lines (85 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
90
void vehicle_table_printer (vehicle vehicle_info)
{
for (int y=12;y<36;y++)
{
gotoxy(31,y);
cout<<"|";
gotoxy(102,y);
cout<<"|";
}
for (int y=11;y<36;y+=4)
{
gotoxy(32,y);
cout << setfill ('-') << setw (70)<<"-";
}
gotoxy(32,13);
cout <<"vehicles's id : "<<vehicle_info.id;
gotoxy(32,17);
cout <<"vehicle's name : "<<vehicle_info.name;
gotoxy (32,21);
cout<<"vehicle's type: "<<vehicle_info.type;
gotoxy(32,25);
cout<<"vehicle's plate number: "<<vehicle_info.plate_no;
gotoxy (32,29);
cout<<"vehicle's price per day: "<<vehicle_info.price;
gotoxy (32,33);
switch (vehicle_info.availablity)
{
case 0:
cout<<"vehicle's availability: not available ";
break;
case 1:
cout<<"vehicle's availability: available ";
break;
case 2:
cout<<"vehicle's availability: reserved ";
break;
}
gotoxy(32,41);
}
void registry_table_printer (registration registry_info)
{
for (int y=12;y<40;y++)
{
gotoxy(31,y);
cout<<"|";
gotoxy(102,y);
cout<<"|";
}
for (int y=11;y<40;y+=4)
{
gotoxy(32,y);
cout << setfill ('-') << setw (70)<<"-";
}
gotoxy(32,13);
cout <<"customers's id : "<<registry_info.customer_id;
gotoxy(32,17);
cout <<"vehicle's id : "<<registry_info.car_id;
gotoxy (32,21);
cout<<"date rented (dd/mm/yy): "<<registry_info.local_date.day<<"/"<<registry_info.local_date.month<<"/"<<registry_info.local_date.year;
gotoxy(32,25);
cout<<"duration : "<<registry_info.duration<<" days";
gotoxy (32,29);
switch (registry_info.return_check)
{
case 0:
cout<<"is returned: NO ";
break;
case 1:
cout<<"is returned: YES ";
break;
}
gotoxy(32,33);
cout<<"receipt id :" <<registry_info.receipt_id;
gotoxy(32,37);
cout<<" total price :" <<registry_info.total_price;
gotoxy(32,43);
}
void cin_fix()
{
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout<<"invalid input ";
usleep(500000);
system("cls");
}