#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <iomanip>
using namespace std;
int main()
{
string nama[25],nim[10],mkul[20],grade[5],ket[25];
int total[15],tugas[5],uts[5],uas[5];
int y,z;
char lagi;
atas :
cout<<" Program Latihan Pembuatan Tamplate Untuk Ujian Akhir Semester "<<endl;
cout<<" ------------------------------------------------------------- "<<endl;
cout<<"Masukan Jumlah data : "; cin>>z;
for (int y=1;y<=z;y++){
cout<<"No urut : " <<y;cout <<endl;
cout<<"Nama Mahasiswa : ";cin>>nama[y];
cout<<"N I M : ";cin>>nim[y];
cout<<"Mata Kuliah : ";cin>>mkul[y];
cout<<"Nilai Tugas : ";cin>>tugas[y];
cout<<"NIlai UTS : ";cin>>uts[y];
cout<<"NIlai UAS : ";cin>>uas[y];
total[y]=(uts[y]+tugas[y]+uas[y])/3;
if (total[y]>=85 && total[y]<=100)
{grade[y]= 'A';
ket[y]="LULUS";}
else if (total[y]>=70 && total[y]<85)
{grade[y]= 'B';
ket[y]="LULUS";}
else if (total[y]>=60 && total[y]<70)
{grade[y]= 'C';
ket[y]="LULUS";}
else if (total[y]>=45 && total[y]<60)
{grade[y]= 'D';
ket[y]="GAGAL";}
else if (total[y]>=0 && total[y]<45)
{grade[y]= 'E';
ket[y]="GAGAL";}
}
cout<<" DAFTAR NILAI MAHASISWA"<<endl;
cout<<"*********************************************************************************************************"<<endl;
cout<<"========================================================================================================="<<endl;
cout<<"| No | NIM | NAMA | Mata Kuliah | TUGAS | UTS | UAS | TOTAL | GRADE | KET |"<<endl;
cout<<"========================================================================================================="<<endl;
for (y=1;y<=z;y++)
{
cout<<"|"<<setw(4);cout<<y;
cout<<"|"<<setw(9);cout<<nim[y] ;
cout<<"|"<<setw(14);cout<<nama[y];
cout<<"|"<<setw(20);cout<<mkul[y];
cout<<"|"<<setw(7);cout<<tugas[y];
cout<<"|"<<setw(7);cout<<uts[y];
cout<<"|"<<setw(7);cout<<uas[y];
cout<<"|"<<setw(9);cout<<total[y];
cout<<"|"<<setw(9);cout<<grade[y];
cout<<"|"<<setw(8);cout<<ket[y];
cout<<"|"<<endl;
}
cout <<endl;
cout<<"Ingin Menambahkan Data Lagi [Y/N] : ";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto atas;
return 0;
}
No comments:
Post a Comment