Senin, 17 September 2012

Program Hitungan Nilai Akhir Bahasa C++

Script Program 



main()
{
float a,b,c,d,e,f,g ;
char nama[25];
clrscr();
cout<<"\n\Oleh : W.A ";
cout<<"\n\NPM  : 999   ";
cout<<"\n\ ===================================== ";
cout<<"\n\ PROGRAM HITUNG NILAI AKHIR ";
cout<<"\n\ ===================================== ";
cout<<"\n\*****************************************************************";
cout<<"\n\  masukan data  ";
cout<<"\n\   ";
printf("\n\Nama Mahasiswa     : ");scanf("%s",nama);
printf("Nilai Keaktifan    : ");scanf("%f",&a);
printf("Nilai Tugas        : ");scanf("%f",&b);
printf("Nilai Ujian        : ");scanf("%f",&c);
d = a*20/100;
e = b*30/100;
f = c*50/100;
g = d+e+f;
cout<<"***************************************************************** ";
cout<<"\n\                       HASIL NILAI                                 ";
cout<<"\n\------------------------------------------------------------------ ";
printf("\n\Mahasiswa yang bernama %s ",nama);
printf("\n\Nilai Keaktifan %5.1f ",d);
printf("\n\Nilai Keaktifan %5.1f ",e);
printf("\n\Nilai Keaktifan %5.1f ",f);
printf("\n\jadi mahasiswa yang bernama %s memperoleh nilai akhir sebesar %5.2f ",nama, g);


getche();

}

Tidak ada komentar:

Poskan Komentar