- Home »
- Belajar C++ "Mencari Grade Mahasiswa" || Teknik Informatika STT-PLN
On
Wednesday, May 29, 2013
Nahh....ini adalah program menggunakan Borland C++ untuk mencari Grade Mahasiswa di STT-PLN Jakarta.
#include<iostream.h>
main ()
{int tugas, uts, uas;
float grade, nilai;
cout<<"tugas = ";cin>>tugas;
cout<<"uts = ";cin>>uts;
cout<<"uas = ";cin>>uas;
nilai = (tugas*0.3) + (uts*0.3) + (uas*0.4);
cout<<"nilai akhir = "<<nilai;
if
(nilai>80)
{cout<<"\nA";}
else if (nilai>70)
{cout<<"\nB";}
else if (nilai>60)
{cout<<"\nC";}
else if (nilai>45)
{cout<<"\nD";}
else if (nilai<45)
{cout<<"\nE";}
else
{cout<<"nilai salah";}
}