Sabtu, 23 April 2011

tugas 6

#include <iostream.h>
#include <conio.h>
#include <stdio.h>
main()
{
char nama[50],jurusan[20],nim[8],kelas[10];
int absen,teori,praktek,ratarata;
cout<<"==========================================="<<endl;
cout<<"\tPROGRAM NILAI AKHIR PENJASKES"<<endl;
cout<<"==========================================="<<endl;
cout<<"NIM            = ";cin>>nim;
cout<<"Nama            = ";gets(nama);
cout<<"jurusan            = ";cin>>jurusan;
cout<<"nilai absen        = ";cin>>absen;
cout<<"nilai teori        = ";cin>>teori;
cout<<"nilai praktek        = ";cin>>praktek;
cout<<"============================================"<<endl;

ratarata= (absen+teori+praktek)/3;

                  if(ratarata>80)
                  {
                  cout<<"nilai akhir        = "<<ratarata<<endl;
                  cout<<"GRADE            = A\n";
                  cout<<"keterangan        = SANGAT BAIK";
                  }
                  else
                  if(ratarata>70)
                  {
                  cout<<"nilai akhir        = "<<ratarata<<endl;
                  cout<<"GRADE            = B\n";
                  cout<<"keterangan        = BAIK";
                  }
                  else
                  if(ratarata>60)
                  {
                  cout<<"nilai akhir         = "    <<ratarata<<endl;
                  cout<<"GRADE                = C\n";
                  cout<<"keterangan              = CUKUP";
                  }
                  else
                  {
                  cout<<"Nilai akhir    = "<<ratarata<<endl;
                  cout<<"GRADE    = D\n";
                  cout<<"keterangan    = KURANG";
                  }
cout<<endl;                 
cout<<"============================================"<<endl;
                  getch();
                  }

download aje bosss!!!

0 komentar:

Posting Komentar