# include <conio.h>
# include <iostream.h>
main()
{
int nilai;
float bobot;
char huruf;
char ket;
clrscr();
cout <<"\n**************************************";
cout <<"\n* Perhitungan Indeks Prestasi (IP) *";
cout <<"\n**************************************";
cout <<"\n";
cout <<"\nMasukkan nilai Anda ! : "; cin >>nilai;
//Untuk If-Else Multi Kondisi(kondisi1 & kondisi2), maka diperlukan operator LOGIKA && untuk relasi AND, dan operator LOGIKA || untuk relasi OR
if ((nilai>=80)&&(nilai<=100))
{
ket = 'A';
bobot = 4.00;
}
else if ((nilai>=71)&&(nilai<=79))
{
ket = 'B+';
bobot = 3.50;
}
else if ((nilai>=65)&&(nilai<=70))
{
ket = 'B';
bobot = 3.00;
}
else if ((nilai>=61)&&(nilai<=64))
{
ket = 'C+';
bobot = 2.50;
}
else if ((nilai>=56)&&(nilai<=60))
{
ket = 'C';
bobot = 2.00;
}
else if ((nilai>=40)&&(nilai<=55))
{
ket = 'D';
bobot = 1.00;
}
else
{
ket = 'E';
bobot = 0.00;
}
cout <<"\n\n";
cout <<"\n================";
cout <<"\n= NILAI ANDA =";
cout <<"\n================";
cout <<"\n";
cout <<"\nAngka = " <<nilai;
cout <<"\nHuruf = " <<ket;
cout <<"\nBobot = " <<bobot;
getch();
}
Search
Categories
- Part I : Perkenalan (4)
- Part II : Operator (3)
- Part III : Percabangan (materi) (2)
- Part III : Percabangan (program) (4)
- Part IV : Perulangan (meteri) (3)
- Part IV : Perulangan (program) (3)
- Part V : Array (materi) (1)
- Part V : Array (program) (2)
- Penerapan (6)
- Pointer (2)
- Searching (pencarian) (3)
- Typedef (1)