[c++] Contoh Program Menghitung Nilai akhir

*ini hanyalah postingan lamaku http://sandroid11.blogspot.com/2012/03/program-menghitung-nilai-akhir.html
untuk beberapa postingan kali ini aku hanya mengambilnya dari bekas blog yang sudah kusam..

dan kali ini tentang menguhitung nilai akhir dengan CPP

# include <iostream.h>
# include <conio.h>
# include <string.h>
int main()
{
    system("TITLE San Sandiah(Manadosoft.com)");
char nama[20],*Grade, *kategori;
float nk,nt,nu,nmk,nmt,nmu,na;
cout<< "\t\t\tProgram Hitung Nilai Akhir Siswa"<<endl;
cout<< endl;
cout<<   "Masukkan Nama Siswa : "; cin>>nama;
cout<<   "Nilai Keaktifan     : "; cin>>nk;
cout<<   "Nilai Tugas         : "; cin>>nt;
cout<<   "Nilai Ujian         : "; cin>>nu;
cout<<endl;
           nmk=nk*0.2;
           nmt=nt*0.3;
           nmu=nu*0.5;
           na=nmk+nmt+nmu;
           Grade;
           kategori;
    if(na>=80)
              {
                          Grade="A";
                          kategori="Lulus";
                          }
                          else if(na>=70)
                          {
                          Grade="B";
                          kategori="Lulus";
                          }
                          else if(na>=59)
                          {
                          Grade="C";
                          kategori="Lulus";
                          }
                          else if(na>=50)
                          {
                          Grade="D";
                          kategori="Lulus Bersyarat";
                          }
                          else
                          {
                          Grade="E";
                          kategori="Tidak Lulus";
                          }
                         
cout<<     "Hasil Akhir"<<endl;
cout<<     "Nama Siswa : " <<nama<<endl;
cout<<     "Nilai Murni Keaktifan x 20%    : "<<nmk<<endl;
cout<<     "Nilai Murni Tugas     x 30%    : "<<nmt<<endl;
cout<<     "Nilai Murni Ujian     x 50%    : "<<nmu<<endl;
cout<<     "Memperoleh Nilai Akhir Sebesar : "<<na<<endl;
cout<<     "Grade yang di dapat            : "<<Grade<<endl;
cout<<     endl;
cout<<     "\t\t"<<nama<<"  Dinyatakan ["<<kategori<<"]"<<endl;
getch();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s