#include<conio.h>
#include<stdio.h>
#include<iostream.h>
main()
{
char nama[20];
float nk,nt,nu,nmk,nmt,nmu,na;
cout<<"Nama siswa : ";gets(nama);
cout<<"Nilai keaktifan : ";cin>>nk;
cout<<"Nilai tugas : ";cin>>nt;
cout<<"Nilai ujian : ";cin>>nu;
nmk=nk*0.2;
nmt=nt*0.3;
nmu=nu*0.5;
na=(nmk+nmt+nmu)/3;
cout<<endl;
cout<<"------------------------------"<<endl;
cout<<"Siswa yang bernama : "<<nama<<endl;
cout<<"Dengan nilai persentasi yang dihasilkan "<<endl<<endl;
cout<<"Nilai keaktifan * 20% : "<<nmk<<endl;
cout<<"Nilai tugas * 30% : "<<nmt<<endl;
cout<<"Nilai ujian * 50% : "<<nmu<<endl<<endl;
cout<<"Jadi siswa yang bernama : "<<nama<<endl;
cout<<"Memperoleh nilai akhir sebesar : "<<na<<endl;
getche();
}
Output:
Monday, January 10, 2011
Program Hitung Nilai Mahasiswa dgn Fungsi IF
Label:
Borland c++
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment