Program Menghitung Nilai Mahasiswa (Kehadiran, Tugas, UTS, UAS) C++

#include<conio.h>
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int jm, sks;
char matkul[50];
cout<<“—————————————————
“;
cout<<” Pemrograman & Algoritma I
“;
cout<<“—————————————————
“;
cout<<“Mata Kuliah : “; cin>>matkul;
cout<<“SKS [2/3] : “; cin>>sks;
cout<<”
Jumlah Mahasiswa : “;
cin>>jm;

char nama[50][100];
int nim[20];
int hadir[2];
int tugas[2];
int uts[2];
int uas[2];
int akhir[10];
int grade[2];

for(int i=1; i<=jm; i++)
{
cout<<”
“<<endl;
cout<<“Mahasiswa Ke-“<<i<<endl;
cout<<“——————————-
“<<endl;
cout<<“Nim (ex:2016xxxxxx) : “;
cin>>nim[i];
cout<<“Nama (Tanpa spasi) : “;
cin>>nama[i];
cout<<“Jumlah Kehadiran : “;
cin>>hadir[i];
if (sks==3)
{
if(hadir[i]==17)
hadir[i]=10;
else if(hadir[i]==16)
hadir[i]=9;
else if(hadir[i]==15)
hadir[i]=8;
else if(hadir[i]==14)
hadir[i]=7;
else if(hadir[i]<=13)
hadir[i]=0;
}
else if (sks==2)
{
if(hadir[i]==14)
hadir[i]=10;
else if(hadir[i]==13)
hadir[i]=9;
else if(hadir[i]==12)
hadir[i]=8;
else if(hadir[i]==11)
hadir[i]=7;
else if(hadir[i]<=10)
hadir[i]=0;
}
cout<<“Nilai Tugas : “;
cin>>tugas[i];
cout<<“Nilai UTS : “;
cin>>uts[i];
cout<<“Nilai UAS : “;
cin>>uas[i];
akhir[i]=(hadir[i]*1)+(tugas[i]*0.2)+(uts[i]*0.3)+(uas[i]*0.4);
}
cout<<”
“<<endl;
cout<<“=============================================================================”<<endl;
cout<<” UNIVERSITAS PAMULANG “<<endl;
cout<<“=============================================================================”<<endl;
cout<<”
“<<endl;
cout<<” Mata Kuliah : “<<matkul<<endl;
cout<<” SKS : “<<sks<<endl;
cout<<“—————————————————————————–“<<endl;
cout<<“Nim Grade Hadir Tugas UTS UAS Nilai “<<endl;
cout<<“—————————————————————————–“<<endl;
for (int i=1;i<=jm;i++)
{
cout<<nim[i];
if (akhir [i]>=80)
cout<<” A”;
else if (akhir [i]=70)
cout<<” B”;
else if (akhir [i]>=60)
cout<<” C”;
else if (akhir [i]>=50)
cout<<” D”;
else if (akhir [i]<50)
cout<<” E”;
cout<<” “<<hadir[i];
cout<<” “<<tugas[i];
cout<<” “<<uts[i];
cout<<” “<<uas[i];
cout<<” “<<akhir [i];

cout<<endl;

}
cout<<“=============================================================================”<<endl;
cout<<”
“<<endl;
cout<<” TO: Sinakgondok.com”<<endl;
}