Anda di halaman 1dari 5




MOCHAMAD YUSUF
#include <iostream>
/*===============================
Menghitung Nilai Akhir Ujian Anda
===============================*/
using namespace std;
int main()
{
//Variable
int k1, k2, u, p, cp1, cp2, na;
float proses_20 = 20, proses_40 = 40, cp2_40 = 40, cp1_60 = 60;
//Input nilai proses
cout<<"=========================================="<<endl;
cout<<"Masukan Nilai Akhir Mata Kuliah Ujian Anda"<<endl;
cout<<"=========================================="<<endl;
cout<<"Nilai Kuis Pertama Anda\t\t:";cin>>k1;
k1=k1*proses_20/100;
cout<<"Nilai Kuis Kedua Anda\t\t:";cin>>k2;
k2=k2*proses_20/100;
cout<<"Nilai Ujian Anda\t\t:";cin>>u;
u=u*proses_20/100;
cout<<"Nilai Praktikum Anda\t\t:";cin>>p;
p=p*proses_40/100;
cout<<"Nilai Capaian Pembelajaran 1\t:";cin>>cp1;
cp1=cp1*cp1_60/100;
cout<<"Nilai Capaian Pembelajaran 2\t:";cin>>cp2;
cp2=cp2*cp2_40/100;
cout<<"=========================================="<<endl;
//proses ending
na=(k1+k2+u+p+cp1+cp2)/2;
//Input cp1 & cp2

//Output nilai proses


cout<<"=========================================="<<endl;
cout<<"Nilai Kuis Pertama\t\t:"<<k1<<endl;
cout<<"Nilai Kuis Kedua\t\t:"<<k2<<endl;
cout<<"Nilai Ujian\t\t\t:"<<u<<endl;
cout<<"Nilai Praktikum\t\t\t:"<<p<<endl;
cout<<"Nilai Proses Anda\t\t:"<<na<<endl;
cout<<"=========================================="<<endl;
//Output cp1 & cp2
cout<<"=========================================="<<endl;
cout<<"Nilai Capaian Pembelajaran 1\t:"<<cp1<<endl;
cout<<"Nilai Capaian Pembelajaran 2\t:"<<cp2<<endl;
cout<<"=========================================="<<endl;
//Output total proses+cp
if ((na>=90)&&(na<=100))
{
cout<<"Nilai IP Anda Adalah = A"<<endl;
}
else if ((na>=80)&&(na<=89))
{
cout<<"Nilai IP Anda Adalah = B+"<<endl;
}
else if ((na>=70)&&(na<=79))
{
cout<<"Nilai IP Anda Adalah = B"<<endl;
}
else if ((na>=60)&&(na<=69))
{
cout<<"Nilai IP Anda Adalah = C+"<<endl;
}
else if ((na>=50)&&(na<=59))
{
cout<<"Nilai IP Anda Adalah = C"<<endl;
}
else if ((na>=40)&&(na<=49))
{
cout<<"Nilai IP Anda Adalah = D"<<endl;
}
else if ((na>=0)&&(na<=39))
{
cout<<"Nilai IP Anda Adalah = E"<<endl;
}
else
{
cout<<"Anda Salah Menginputkan Nilai"<<endl;
}
return 0;
}
Compile & Run:
#include <iostream>
using namespace std;
int main()
{
//variable
float al, mm, di, ip;
//input
cout<<"=========================================="<<endl;
cout<<"Masukan Jumlah Nilai Bobot Anda"<<endl;
cout<<"=========================================="<<endl;
cout<<"Masukan Nilai Algoritma Anda\t\t:";cin>>al;
al*3;
cout<<"Masukan Nilai Multimedia Anda\t\t:";cin>>mm;
mm*3;
cout<<"Masukan Nilai Sistem Digital Anda\t:";cin>>di;
di*3;
ip=(al+mm+di)/3;
//output
cout<<"=========================================="<<endl;
cout<<"IP Yang Anda Peroleh\t\t\t:"<<ip<<endl;
if ((ip>=3.6)&&(ip<=4))
{
cout<<"Anda Memperoleh IP A"<<endl;
}
else if ((ip>=3)&&(ip<=3.5))
{
cout<<"Anda Memperoleh IP B+"<<endl;
}
else if ((ip>=2.6)&&(ip<=2.9))
{
cout<<"Anda Memperoleh IP B"<<endl;
}
else if ((ip>=2.1)&&(ip<=2.5))
{
cout<<"Anda Memperoleh IP C+"<<endl;
}
else if ((ip>=1.1)&&(ip<=2))
{
cout<<"Anda Memperoleh IP C"<<endl;
}
else if ((ip>=0.1)&&(ip<=1))
{
cout<<"Anda Memperoleh IP D"<<endl;
}
else if (ip==0)
{
cout<<"Anda Memperoleh IP E"<<endl;
}
else
{
cout<<"Maaf, Anda Salah Menginput Nilai Bobot"<<endl;
}
return 0;
}
Compile & Run: