#include <iostream.h>
#include <conio.h>
#include <stdio.h>
main()
{
char nama[50],jurusan[20],nim[8];
int nilai1,nilai2,nilai3,nilai4,nilai5;
cout<<"\tPROGRAM NILAI FISIKA"<<endl;
cout<<"==========================="<<endl;
cout<<"NIM = ";cin>>nim;
cout<<"Nama = ";gets(nama);
cout<<"nilai absen =";cin>>nilai1;
cout<<"nilai tugas =";cin>>nilai2;
cout<<"nilai ulangan =";cin>>nilai3;
cout<<"nilai praktek =";cin>>nilai4;
nilai5= (nilai1+nilai2+nilai3+nilai4)/4;
if(nilai5>90)
{
cout<<"nilai akhir ="<<nilai5<<endl;
cout<<"GRADE =A\n";
cout<<"keterangan =sangat baik";
}
else
if(nilai5>80)
{
cout<<"nilai akhir ="<<nilai5<<endl;
cout<<"GRADE =B\n";
cout<<"keterangan =baik";
}
else
if(nilai5>70)
{
cout<<"nilai akhir =" <<nilai5<<endl;
cout<<"GRADE =C\n";
cout<<"keterangan =cukup";
}
else
{
cout<<"Nilai akhir ="<<nilai5<<endl;
cout<<"GRADE =D\n";
cout<<"keterangan =kurang";
}
getch();
}
No Comments
tugas 6
.