forked from Anuragcoderealy/Codenewhacktober
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fare Calculator.cpp
155 lines (114 loc) · 3.68 KB
/
Fare Calculator.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#include <iostream>
#include <string>
using namespace std;
//Name: Harsh Chaudhary
//Student ID: 101428605
int main() {
int inspectioncharge = 75;
string vehiclenumber, Customer_name, work;
float hours, partcost, Total, labcharge;
bool workdone;
//customer details
cout << "Customer Name: ";
getline(cin, Customer_name);
cout << "Vehicle Number: ";
getline(cin, vehiclenumber);
cout << "workdone on the vehicle(0 or 1):";
cin >> workdone;
cout << "Time labour worked(in hrs):";
cin >> hours;
cout << "Cost of the part:$";
cin >> partcost;
labcharge = 75 * hours;
Total = labcharge + partcost;
system("CLS");
if (workdone == 0)
{
//Company's Info
cout << "* XYZ Repair Shop *" << endl;
cout << endl;
cout << "Contact No: +1 4**-2**-2***" << endl;
cout << "Email id: xyz_car_repairs@gmail.com" << endl;
cout << endl;
cout << "--------------------------------------------------------------" << endl;
// Date & Time
cout << "Date: " << __DATE__ << endl;
cout << "Time: " << __TIME__ << endl;
//customer details
cout << "Customer Name: ";
cout << Customer_name << endl;
cout << "Vehicle Number: ";
cout << vehiclenumber << endl;
cout << endl;
//Receipt
cout << " ----Reciept----" << endl;
cout << endl;
cout << "Inspection charge: $" << inspectioncharge << endl;
cout << "Cost of parts : $ 0" << endl;
cout << "------------------------" << endl;
cout << "Total cost : $" << inspectioncharge << endl;
cout << "------------------------" << endl;
}
//When total price is less than $120
else if (Total < 120)
{
//company's info
cout << "* XYZ Repair Shop *" << endl;
cout << endl;
cout << "Contact No: +1 4**-2**-2***" << endl;
cout << "Email id: xyz_car_repairs@gmail.com" << endl;
cout << endl;
cout << "--------------------------------------------------------------" << endl;
// Date & Time
cout << "Date: " << __DATE__ << endl;
cout << "Time: " << __TIME__ << endl;
//customer details
cout << "Customer Name: ";
cout << Customer_name << endl;
cout << "Vehicle Number: ";
cout << vehiclenumber << endl;
cout << endl;
//Receipt
cout << " ----Reciept----" << endl;
cout << endl;
cout << "Cost of parts(not incl): $";
cout << partcost << endl;
cout << "Minimum charges applied: $120 " << endl;
cout << "-----------------------------" << endl;
cout << "Total repair cost: $";
cout << "120" << endl;
cout << "-----------------------------" << endl;
}
//when Total charge is more than $120
else
{
//company's info
cout << "* XYZ Repair Shop *" << endl;
cout << endl;
cout << "Contact No: +1 4**-2**-2***" << endl;
cout << "Email id: xyz_car_repairs@gmail.com" << endl;
cout << endl;
cout << "--------------------------------------------------------------" << endl;
// Date & Time
cout << "Date: " << __DATE__ << endl;
cout << "Time: " << __TIME__ << endl;
//customer details
cout << "Customer Name: ";
cout << Customer_name << endl;
cout << "Vehicle Number: ";
cout << vehiclenumber << endl;
cout << endl;
//Receipt
cout << " ----Reciept----" << endl;
cout << endl;
cout << "Cost of parts : $";
cout << partcost << endl;
cout << "Labour charge : $";
cout << labcharge << endl;
cout << "-----------------------------" << endl;
cout << "Total repair cost: $";
cout << Total << endl;
cout << "-----------------------------" << endl;
}
return 0;
}