#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
cout<<"\n\n\t===============================================";
cout<<"\n\t PROGRAM MENGHITUNG NILAI AKHIR";
cout<<"\n\t MATA KULIAH BAHASA PEMROGRAMAN";
cout<<"\n\t===============================================\n";
getch();
int jm;
cout<<"\n\tMasukkan Jumlah Mahasiswa : ";cin>>jm;
char nama[50][100];
int tugas[50];
int uts[50];
int uas[50];
int akhir[50];
for(int i=1; i<=jm; i++)
{
cout<<"\n"<<endl;
cout<<"\tMAHASISWA KE - "<<i<<endl;
cout<<"\t-----------------------------------------\n"<<endl;
cout<<"\tNAMA MAHASISWA : ";cin>>nama[i];
cout<<"\tNIlAI TUGAS : ";cin>>tugas[i];
cout<<"\tNILAI UTS : ";cin>>uts[i];
cout<<"\tNILAI UAS : ";cin>>uas[i];
akhir[i]=(tugas[i]*0.3)+(uts[i]*0.2)+(uas[i]*0.5);
}
getch();
clrscr();
cout<<"\t-------------------------------------------------"<<endl;
for(int i=1; i<=jm; i++)
{
cout<<setw(11)<<i;
cout<<setw(13)<<nama[i];
cout<<setw(12)<<tugas[i];
cout<<setw(7)<<uts[i];
cout<<setw(7)<<uas[i];
cout<<setw(9)<<akhir[i];
if(akhir[i]>=80)
cout<<setw(7)<<"A";
else if(akhir[i]>=70)
cout<<setw(7)<<"B";
else if(akhir[i]>=60)
cout<<setw(7)<<"C";
else if(akhir[i]>=50)
cout<<setw(7)<<"D";
else if(akhir[i]<50)
cout<<setw(7)<<"E";
}
cout<<"\t-------------------------------------------------"<<endl;
cout<<"\n\tTOTAL MAHASISWA = "<<jm<<endl;
getch();
}
Tuesday, 21 October 2014
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment