Posted by Materi Teknik Informatika • Informasi Teknologi Informasi • Digital Marketing on 9/19/2014
/*Program Cek Usia Unsika*/
#include <iostream.h>
#include <conio.h>
void main()
{
cout<<" Program Cek Nilai Unsika"<<endl;
cout<<"-------------------------------------------------------------------------"<<endl;
int notes,nilai;
char nama[30],grade[30],ket[30];
cout<<"Masukan Nama : ";
cin>>nama;
cout<<"Masukan No.Test : ";
cin>>notes;
cout<<"Masukan Nilai : ";
cin>>nilai;
if (nilai<=100&&nilai>=85)
strcpy (grade,"A");
else if (nilai<=85&&nilai>=75)
strcpy (grade,"B");
else if (nilai<=74&&nilai>=60)
strcpy (grade,"C");
else if (nilai<=59&&nilai>=50)
strcpy (grade,"D");
else if (nilai<=49&&nilai>=0)
strcpy (grade,"E");
else strcpy (grade,"Masukan Nilai yang Benar");
if (nilai>=60)
strcpy (ket,"LULUS");
else strcpy (ket,"GAGAL");
cout<<"Siswa ("<<nama<<") Dengan No Tes "<<notes<<endl;
cout<<"Memperoleh nilai "<<nilai<<" grade "<<grade<<endl;
cout<<"anda "<<ket<<endl;
getch();
}
Berikut hasil output Program Cek Nilai Mahasiswa yang dihasilkan.