Program Nilai Kelulusan Mahasiswa

Bismillah.. 🙂

Program Sederhana menentukan kelulusan mahasiswa .. 🙂

1. Kode Program


#include <iostream>
using namespace std;

int main()
{
 double uts, uas, tugas, rata2;
 char nama[20];
 char nim[20];
 char indeks;
 char ket[20];
 cout <<"----------------- Pemrograman C++ ----------------------" <<endl;
 cout <<" Menentukan Kelulusan Nilai Mahasiswa" <<endl;
 cout <<"--------------------------------------------------------" <<endl;
 cout <<"Masukkan Data Mahasiswa" <<endl;
 cout <<"=======================" <<endl;
 cout <<"Nama Mahasiswa : ";
 cin.getline(nama, 20);
 cout <<"NIM : ";
 cin.getline(nim, 20);
 cout <<"Nilai UAS : ";
 cin >>uas;
 cout <<"Nilai UTS : ";
 cin >>uts;
 cout <<"Nilai Tugas : ";
 cin >>tugas;
 rata2 = (uts+uas+tugas)/ 3;

if(rata2 >=85){
 indeks='A';
 strcpy(ket, "LULUS");
 }else if(rata2 <85 && rata2 >=65) {
 indeks='B';
 strcpy(ket, "LULUS");
 }
 else if(rata2 <65 && rata2 >=55) {
 indeks='C';
 strcpy(ket, "LULUS");
 }
 else if(rata2 <55 && rata2 >=45) {
 indeks='D';
 strcpy(ket, "TIDAK LULUS");
 }else{
 indeks='E';
 strcpy(ket, "TIDAK LULUS");
 }
 cout <<"\n";
 cout <<"----- Hasil Kelulusan Mahasiswa --- " <<endl;
 cout <<"===================================" <<endl;
 cout <<"Nama : " <<nama<<endl;
 cout <<"NIM : " <<nim<<endl;
 cout <<"Nilai UAS : "<<uas<<endl;
 cout <<"Nilai UTS : "<<uts<<endl;
 cout <<"Nilai Tugas : "<<tugas<<endl;
 cout <<"Rata-rata : "<<rata2<<endl;
 cout <<"Indeks : " <<indeks<<endl;
 cout <<"Ketarangan : " <<ket<<endl;

system("pause");
 return 0;

}

Output program :

lulus

2. Video Tutorial

terima Kasih, semoga bermanfaat.. 🙂

 

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s