-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompleteGPACalc.cpp
More file actions
66 lines (63 loc) · 1.69 KB
/
CompleteGPACalc.cpp
File metadata and controls
66 lines (63 loc) · 1.69 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
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
char x;
float y,z,a=0,sks=0,bobot=0,ip=0;
do
{
a=a+1;
cout << "Masukan nilai ke-" << a << " = ";
cin >> x;
if(x!='X')
{
cout << "Masukan bobot SKS ke-" << a << "= ";
cin >> y;
if(x=='A')
{
z=4*y;
cout << "Nilai A=4, bobot " << z << endl;
}
else
{
if(x=='B')
{
z=3*y;
cout << "Nilai B=3, bobot " << z << endl;
}
else
{
if(x=='C')
{
z=2*y;
cout << "Nilai C=2, bobot " << z << endl;
}
else
{
if(x=='D')
{
z=1*y;
cout << "Nilai D=1, bobot " << z << endl;
}
if(x=='E')
{
z=0*y;
cout << "Nilai E=0, bobot " << z << endl;
}
}
}
}
sks=y+sks;
bobot=z+bobot;
}
} while(x!='X');
ip=bobot/sks;
cout << "Selesai \n";
cout << "Jumlah SKS = " << sks << endl;
cout << "Jumlah bobot= " << bobot << endl;
cout << "IP = " << ip << endl;
system("pause");
return 0;
}