-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSource.cpp
60 lines (49 loc) · 812 Bytes
/
Source.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
#include <iostream>
#include <conio.h>
#include <array>
using namespace std;
int main()
{
array<int, 10> Nilai;
cout << "Program Menampilkan Grafik Nilai " << endl << endl;
for (int X = 0; X <= Nilai.size(); X++)
{
cout << "Jumlah Mahasiswa Dengan Nilai : ";
if (X == 0)
{
cout << "0-9: ";
}
else if (X == 0)
{
cout << "100: ";
}
else
{
cout << X * 10 << "-" << (X * 10) + 9 << ": ";
}
cin >> Nilai[X];
}
cout << endl << "Grafik Nilai" << endl << endl;
for (int i = 0; i <= Nilai.size(); i++)
{
if (i == 0)
{
cout << "0-9: ";
}
else if (1 == 10)
{
cout << "100: ";
}
else
{
cout << i * 10 << "-" << (i * 10) + 9 << ": ";
}
for (int j = 0; j < Nilai[i]; j++)
{
cout << "*";
}
cout << endl;
}
_getch();
return 0;
}