Membuat Grade Nilai Dev C++
Hai Guys Kali ini Saya akan berbagi Bagaimana Caranya membuat Grade Nilai Dengan Dev C++
#include<iostream>
using namespace std;
main()
{
char nama[10],nim[10];
float nilai_1,nilai_2,nilai_3,total,rata;
cout<<"NAMA : Fathurrahman.M\n";
cout<<"PRODI : TEKNIK INFORMATIKA ITN MALANG\n";
cout<<"==========================================\n";
cout<<"PROGRAM MENENTUKAN GRADE NILAI MAHASISWA\n";
cout<<endl;
cout<<"Masukkan Nama : ";cin>>nama;
cout<<"Masukkan Nim : ";cin>>nim;
cout<<endl;
cout<<"Masukkan Nilai Tugas : ";cin>>nilai_1;
cout<<"Masukkan Nilai UTS : ";cin>>nilai_2;
cout<<"Masukkan Nilai UAS : ";cin>>nilai_3;
cout<<"==========================================\n";
total=nilai_1+nilai_2+nilai_3;
cout<<endl;
cout<<"Nama Mahasiswa : "<<nama<<endl;
cout<<"Nim Mahasiswa : "<<nim<<endl;
cout<<"Total Nilai : "<<total<<endl;
rata=total/3;
cout<<"Rata-Rata Nilai : "<<rata<<endl;
if(rata>=80 && rata<=100)
cout<<"Grade Nilai : A"<<endl;
if(rata>=71 && rata<=79)
cout<<"Grade Nilai : B+"<<endl;
if(rata>=65 && rata<=70)
cout<<"Grade Nilai : B"<<endl;
if(rata>=61 && rata<=64)
cout<<"Grade Nilai : C+"<<endl;
if(rata>=56 && rata<=60)
cout<<"Grade Nilai : C"<<endl;
if(rata>=40 && rata<=55)
cout<<"Grade Nilai : D"<<endl;
if(rata>=0 && rata<=39)
cout<<"Grade Nilai : E"<<endl;
}
Setelah diCompile maka akan muncul seperti ini
Selamat Mencoba Guys
#include<iostream>
using namespace std;
main()
{
char nama[10],nim[10];
float nilai_1,nilai_2,nilai_3,total,rata;
cout<<"NAMA : Fathurrahman.M\n";
cout<<"PRODI : TEKNIK INFORMATIKA ITN MALANG\n";
cout<<"==========================================\n";
cout<<"PROGRAM MENENTUKAN GRADE NILAI MAHASISWA\n";
cout<<endl;
cout<<"Masukkan Nama : ";cin>>nama;
cout<<"Masukkan Nim : ";cin>>nim;
cout<<endl;
cout<<"Masukkan Nilai Tugas : ";cin>>nilai_1;
cout<<"Masukkan Nilai UTS : ";cin>>nilai_2;
cout<<"Masukkan Nilai UAS : ";cin>>nilai_3;
cout<<"==========================================\n";
total=nilai_1+nilai_2+nilai_3;
cout<<endl;
cout<<"Nama Mahasiswa : "<<nama<<endl;
cout<<"Nim Mahasiswa : "<<nim<<endl;
cout<<"Total Nilai : "<<total<<endl;
rata=total/3;
cout<<"Rata-Rata Nilai : "<<rata<<endl;
if(rata>=80 && rata<=100)
cout<<"Grade Nilai : A"<<endl;
if(rata>=71 && rata<=79)
cout<<"Grade Nilai : B+"<<endl;
if(rata>=65 && rata<=70)
cout<<"Grade Nilai : B"<<endl;
if(rata>=61 && rata<=64)
cout<<"Grade Nilai : C+"<<endl;
if(rata>=56 && rata<=60)
cout<<"Grade Nilai : C"<<endl;
if(rata>=40 && rata<=55)
cout<<"Grade Nilai : D"<<endl;
if(rata>=0 && rata<=39)
cout<<"Grade Nilai : E"<<endl;
}
Setelah diCompile maka akan muncul seperti ini
Selamat Mencoba Guys
Komentar
Posting Komentar