#include <iostream>
#include <iomanip>
#include<conio.h>
#include<stdio.h>
using namespace std;
int main()
{
int pilih;
float UTS[3], UAS[3],TOTAL[3],tugas[3],nim[15];
int i,z;
char a, nama[35][50],GRADE[4];
string ket[10], mkul;
atas :
// system("cls");
cout<<" Masukan Jumlah data Mahasiswa: "; cin>>z;
cout<<" Masukan Mata Kuliah : "; cin>>mkul;
for (int i=1;i<=z;i++)
{
cout<<" No urut : " <<i <<". ";cout <<endl;
cout<<" Masukan Nama Mahasiswa : "; cin>>nama[i];
cout<<" Masukan NIM :"; cin>>nim[i];
cout<<" Masukan Nilai TUGAS : "; cin>>tugas[i];
cout<<" Masukan Nilai UTS : "; cin>>UTS[i];
cout<<" Masukan Nilai UAS : "; cin>>UAS[i];
cout<<endl;
}
// system("cls");
TOTAL[i]=(tugas[i]+UTS[i]+UAS[i])/3;
for (i=1;i<=z;i++)
{
if ((TOTAL[i]==85)&&(TOTAL[i]<=100))
{
GRADE[i]='A';
ket[i]=" LULUS ";
}
else if ((TOTAL[i]>=70)&&(TOTAL[i]<85))
{
GRADE[i]='B';
ket[i]=" LULUS ";
}
else if ((TOTAL[i]>=60)&&(TOTAL[i]<70))
{
GRADE[i]='C';
ket[i]=" GAGAL ";
}
else if ((TOTAL[i]>=45)&&(TOTAL[i]<60))
{
GRADE[i]='D';
ket[i]=" GAGAL ";
}
else if ((TOTAL[i]==0)&&(TOTAL[i]<45))
{
GRADE[i]='E';
ket[i]=" GAGAL ";
}
}
cout<<" Nama MAta Kuliah : " <<mkul;cout<<endl;
cout<<" DAFTAR NILAI MAHASISWA "<<endl;
cout<<" STIOKOM UYELINDO KUPANG "<<endl;
cout<<"*******************************************************************************"<<endl<<endl;
cout<<"===========================================================================----"<<endl;
cout<<"| No | Nim | Nama Mhs | TGS | UTS | UAS |TOTAl | GRADE | KET |"<<endl;
cout<<"==============================================================================="<<endl;
for (int i=1;i<=z;i++)
{
cout<<"|"<<setw(4);cout<<i;
cout<<"|"<<setw(12);cout<< nim [i];
cout<<"|"<<setw(17);cout<<nama [i];
cout<<"|"<<setw(5);cout<<tugas[i];
cout<<"|"<<setw(5);cout<<UTS[i];
cout<<"|"<<setw(5);cout<<UAS[i];
cout<<"|"<<setw(6);cout<<TOTAL[i];
cout<<"|"<<setw(5);cout<<GRADE[i];
cout<<"|"<<setw(11);cout<<ket[i];cout <<endl;
}
cout <<endl;
cout<<" Apakah ingin Menghitung Lagi [ Y / N ]";cin>>a;
if(a=='N'|| a=='n')
goto atas;
//system("pause");
return 0;
}
No comments:
Post a Comment