#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
int main()
{
char nama[20][30],grade[20];
int i,j,k,tgs[20],uts[20],uas[20],akhir[20];
cout<<"##########################################\n";
cout<<"# WELCOME TO UNIVERSITAS PAMULANG #\n";
cout<<"##########################################\n";
cout<<" PROGRAM HITUNG NILAI AKHIR "<<endl;
cout<<" ALGORITMA DAN PEMOGRAMAN 1 "<<endl<<endl;
cout<<" Masukan Jumlah Mahasiswa : ";cin>>j;
cout<<" Masukan SKS : 2"<<endl;
cout<<endl;
for(i=1;i<=j;i++)
{
cout<<" Mahasiswa Ke - "<<i<<endl;
cout<<" Nama Mahasiswa : ";cin>>nama[i];
cout<<" Nilai Tugas : ";cin>>tgs[i];
cout<<" Nilai UTS : ";cin>>uts[i];
cout<<" Nilai UAS : ";cin>>uas[i];
akhir[i]=(tgs[i]*0.3)+(uas[i]*0.3)+(uas[i]*0.4);
if(akhir[i]>=80)
grade[i]='A';
else if(akhir[i]>=70&&akhir[i*2]<80)
grade[i]='B';
else if(akhir[i]>=59&&akhir[i*2]<70)
grade[i]='C';
else if(akhir[i]>=50&&akhir[i*2]<59)
grade[i]='D';
else
grade[i]='E';
cout<<endl;
}
cout<<" DAFTAR NILAI "<<endl;
cout<<" ALGORITMA DAN PEMOGRAMAN 1 "<<endl;
cout<<" SKS : 2"<<endl;
cout<<"--------------------------------------------------------- "<<endl;
cout<<"No. Nama Nilai "<<endl;
cout<<" Mahasiswa ----------------------------- Grade "<<endl;
cout<<" Tugas UTS UAS Akhir "<<endl;
cout<<"--------------------------------------------------------- "<<endl;
for(i=1;i<=j;i++)
{
cout<<setiosflags(ios::left)<<setw(5)<<i;
cout<<setiosflags(ios::left)<<setw(14)<<nama[i];
cout<<setiosflags(ios::left)<<setw(8)<<tgs[i];
cout<<setiosflags(ios::left)<<setw(8)<<uts[i];
cout<<setiosflags(ios::left)<<setw(8)<<uas[i];
cout<<setiosflags(ios::left)<<setw(10)<<akhir[i];
cout<<setiosflags(ios::left)<<setw(8)<<grade[i]<<endl;
}
cout<<"--------------------------------------------------------- "<<endl;
getch();
}
Tidak ada komentar:
Posting Komentar