Monday, March 18, 2013
program nilai C++
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
struct
{
char nama [20];
char npm [90];
int tugas;
int kuis;
int mid;
int uas;
}mhs;
void main()
{
int i,hasil,nilai_huruf;
ulang:
int n;
cout<<"|============================================|\n";
cout<<"| NILAI MAHASISWA (MIFTAHUL ILMI) | "<<endl;
cout<<"|============================================|\n";
cout<<" "<<endl;
cout<<endl;
cout<<" Masukan Nama Depan = ";cin>>mhs.nama,12;
cout<<" Masukan NIM = ";cin>>mhs.npm;
cout<<endl<<endl;
cout<<" Masukan nilai tugas = ";cin>>mhs.tugas;
cout<<" Masukan nilai kuis = ";cin>>mhs.kuis;
cout<<" Masukan nilai mid = ";cin>>mhs.mid;
cout<<" Masukan nilai uas = ";cin>>mhs.uas;
cout<<endl<<endl;
hasil= (mhs.tugas*10/100+ mhs.kuis*20/100+mhs.mid*30/100+mhs.uas*40/100)/10;
cout<<endl;
cout<<"|===============================|\n";
cout<<"| Data Hasil Inputan |"<<endl;
cout<<"|===============================|\n";
cout<<" Nama = "<<mhs.nama<<endl;
cout<<" NIM = "<<mhs.npm<<endl;
cout<<" nilai Tugas = "<<mhs.tugas<<endl;
cout<<" nilai UTS = "<<mhs.mid<<endl;
cout<<" nilai UAS = "<<mhs.uas<<endl<<endl;
cout<<"Rata-rata Nilai Anda per 10 = "<<hasil<<endl<<endl;
switch (hasil)
{
case 10 :
cout<<" ANDA MENDAPAT GRADIATE : A\n";
cout<<" SELAMAT ANDA LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 9 :
cout<<" ANDA MENDAPAT GRADIATE : A\n";
cout<<" SELAMAT ANDA LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 8 :
cout<<" ANDA MENDAPAT GRADIATE : B\n";
cout<<" SELAMAT ANDA LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 7 :
cout<<" ANDA MENDAPAT GRADIATE : B\n";
cout<<" SELAMAT ANDA LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 6 :
cout<<" ANDA MENDAPAT GRADIATE : D\n";
cout<<" MAAF ANDA TIDAK LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 5 :
cout<<" ANDA MENDAPAT GRADIATE : E\n";
cout<<" MAAF ANDA TIDAK LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 4 :
cout<<" ANDA MENDAPAT GRADIATE : E\n";
cout<<" MAAF ANDA TIDAK LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 3 :
cout<<" ANDA MENDAPAT GRADIATE : E\n";
cout<<" MAAF ANDA TIDAK LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 2 :
cout<<" ANDA MENDAPAT GRADIATE : E\n";
cout<<" MAAF ANDA TIDAK LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 1 :
cout<<" ANDA MENDAPAT GRADIATE : E\n";
cout<<" MAAF ANDA TIDAK LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
case 0 :
cout<<" ANDA MENDAPAT GRADIATE : E\n";
cout<<" MAAF ANDA TIDAK LULUS\n";
cout<<"|===========================|";break;
cout<<endl<<endl;
}
getch();
}
Subscribe to:
Post Comments (Atom)
-
Dapatkan kecepatan terik Gigabit Ethernet dengan D-Link DGS-1024D, Switch 24-Port Gigabit yang memberikan kekuatan, kinerja, dan keha...
-
Motherboard Terbaru MSI Khusus Untuk Gamers Ada gebrakan baru yang dilakukan oleh MSI di tahun 2014 ini. Gebrakan ini dilakukan untuk teru...
-
A. TUJUAN 1. Dengan mengikutiperkuliahaninimahasiswadiharapkanmampumengenal BIOS dalamsetiap PC. 2. Dapatmengetahuifung...
No comments:
Post a Comment