-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquestion17.cpp
More file actions
41 lines (30 loc) · 1.07 KB
/
question17.cpp
File metadata and controls
41 lines (30 loc) · 1.07 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
#include <iostream>
using namespace std;
int main() {
int credithour, roomtype, academic, matriculation, credithourfee, roomfee, totalfee, graduationfee, studentid;
char graduation;
academic = 500000, matriculation = 200000;
cout << "Fill in the following details. \n";
cout << "Student's ID Number (4 digits) ", cin >> studentid;
cout << "Credit Hours", cin >> credithour;
cout << "Room Type (A / R) ", cin >> roomtype;
cout << "Are you a graduating student? (Y / N) ", cin >> graduation;
if (credithour < 15 || credithour > 21) {
cout << "Credit Hours should be in the range of 15 and 21";
system("pause");
}
credithourfee = credithour * 1000;
if (graduation == 'Y') {
int graduationfee = 300000;
} else {
graduationfee = 0;
}
if (roomtype = 'R') {
roomfee = 500000;
} else {
roomfee = 1000000;
}
totalfee = credithourfee + academic + roomfee + + matriculation + graduationfee;
cout << "Total Fees are: GHS " << totalfee;
system("pause");
}