#include <stdio.h>
#include <conio.h>
#include <iostream.h>
main ()
{
char nama[20];
char grade;
float nk,nt,nu,na;
clrscr;
cout<<"++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"\tPROGRAM HITUNG NILAI AKHIR"<<endl;
cout<<"++++++++++++++++++++++++++++++++++++++++++"<<endl;
printf("Nama Siswa : ");gets(nama);
cout<<"Nilai Keaktifan : ";cin>>nk;
cout<<"Nilai Tugas : ";cin>>nt;
cout<<"Nilai Ujian : ";cin>>nu;
nk=nk*0.2;
nt=nt*0.3;
nu=nu*0.5;
na=nk+nt+nu;
cout<<endl;
if (na>=80)
{grade='A' ;}
else
if (na>=70)
{grade='B';}
else
if(na>=59)
{grade='C';}
else
if (na>=50)
{grade='D';}
else
if (na<50)
{grade='E';}
cout<<endl;
cout<<" Siswa yang bernama : "<<nama<<endl;
cout<<" Dengan Nilai Presentasi yang dihasilkan"<<endl;
cout<<" Nilai Keaktifan : "<<nk<<endl;
cout<<" Nilai Tugas : "<<nt<<endl;
cout<<" Nilai Ujian : "<<nu<<endl;
cout<<" Jika Siswa Yang Bernama "<<nama<< " Memperoleh Nilai Akhir sebesar "<<na<<endl;
cout<<" Grade Nilai yang di dapatkan "<<grade<<endl;
getch();
}