#include <iostream.h>
int main ()
{
char mtkul[20];
char sks,nh;
double kehadiran,tm,uts,uas,na;
cout<<"input mata kuliah :";
cin>>mtkul;
cout<<"input jumlah sks :";
cin>>sks;
cout<<"input kehadiran :";
cin>>kehadiran;
cout<<"input nilai tugas mandiri:";
cin>>tm;
cout<<"input nilai uts :";
cin>>uts;
cout<<"input nilai uas :";
cin>>uas;
na=(kehadiran*0.10)+(tm*0.15)+(uts*0.25)+(uas*0.50);
cout<<"nilai akhir :"<<na<<endl;
if (na>=80 && na<=100)
{
nh= 'A';
}
else if (na>=70 && na<=79)
{
nh= 'B';
}
else if (na>=60 && na<=69)
{
nh= 'C';
}
else if (na>=50 && na<=59)
{
nh= 'D';
}
else if (na<=49)
{
nh= 'E';
}
else
{
cout<<"Anda salah input nilai "<<endl;
}
cout<<"*************************"<<endl;
cout<<"mata kuliah :"<<mtkul<<endl;
cout<<"jumlah sks :"<<sks<<endl;
cout<<"nilai akhir :"<<na<<endl;
cout<<"nilai huruf :"<<nh<<endl;
cout<<"**************************"<<endl;
return 0;
}
Rabu, 13 April 2011
contoh program c++ grade nilai
Langganan:
Posting Komentar (Atom)
Tampilan outputnya mana kak admin?soalnya aku ikutin perintah kak admin masih ada error
BalasHapus