Minggu, 20 Mei 2012

PROGRAM MENGHITUNG NILAI UAS


/*PROGRAM NILAI*/
#include<conio.h>
#include<iostream.h>
#include<math.h>
#pragma argsused

int main()
{
    int kom, mat, fis, kim, geo, sos, eko, big, rat, jum, ips, ipa;

    cout<<"PROGRAM NILAI AKHIR"<<endl;
    cout<<"==================="<<endl;
    cout<<"MASUKKAN NILAI UAS MATA PELAJARAN BERIKUT :"<<endl;
    cout<<"-------------------------------------------"<<endl;
    cout<<"1. KOMPUTER   = "; cin>>kom;
    cout<<"2. MATEMATIKA = "; cin>>mat;
    cout<<"3. FISIKA     = "; cin>>fis;
    cout<<"4. KIMIA      = "; cin>>kim;
    cout<<"5. GEOGRAFI   = "; cin>>geo;
    cout<<"6. SOSIOLOGI  = "; cin>>sos;
    cout<<"7. EKONOMI    = "; cin>>eko;
    cout<<"8. B.INGGRIS  = "; cin>>big;
    cout<<endl;
   
    jum=kom+mat+fis+kim+geo+sos+eko+big;
    rat=jum/8;
    ipa=mat+fis+kim;
    ips=geo+sos+eko;
   
    cout<<"Jumlah nilai Anda  = "<<jum<<endl;
    cout<<"Rata-rata nilai    = "<<rat<<endl;
    cout<<"---------------------------"<<endl;
   
    if(ipa>ips)
       cout<<"Jurusan    = IPA"<<endl;
       else if(ips>ipa)
            cout<<"Jurusan    = IPS"<<endl;
            else
                cout<<"Jurusan    = Dalam Pertimbangan"<<endl;
               
    if(rat >=90)
        {
           cout<<"Keterangan = LULUS"<<endl;
           cout<<"Grade Rapot Anda = A";
        }
      else if(rat >= 80)
            {
             cout<<"Keterangan = LULUS"<<endl;
             cout<<"Grade Rapot Anda = B";
            }
         else if(rat >= 75)
            {
             cout<<"Keterangan = Dalam Pertimbangan"<<endl;
             cout<<"Grade Rapot Anda = C";
            }
              else if(rat >= 50)
                {
                   cout<<"Keterangan = TIDAK LULUS"<<endl;
                   cout<<"Grade Rapot Anda = D";
                }
                 else
                     {
                        cout<<"Keterangan = Tidak Naik Kelas"<<endl;
                        cout<<"Grade Rapot Anda = E";
                     }
                    
     getch();
}    
                                                        

0 komentar:

Posting Komentar