#include "string.h"
#include "stdio.h"
#include "iostream.h"
char NH(double na);
double NA(int mid,int uas);
void main(){
char nama[30];char nis[8];char ket[10];
int mid,uas;double na;
cout<<"input Nilai mahasiswa :"<<endl;
cout<<"__________________________________"<<endl;
cout<<"Nis :";gets(nis);
cout<<"Nama :";gets(nama);
cout<<"Nilai mid :";cin>>mid;
cout<<"Nilai uas :";cin>>uas;
na=NA(mid,uas);
cout<<"nilai angka :"<<na<<endl;
cout<<"nilai huruf :"<<NH(na)<<endl;
if(NH(na)=='E') strcpy(ket,"gagal");
else strcpy(ket,"lulus");
cout<<"keterangan :"<<ket;
}
double NA(int mid,int uas){
return(0.4*mid+0.6*uas);
}
char NH(double xna){
char x;
if(xna>=80)x='A';
else if(xna>=70)x='B';
else if(xna>=60)x='c';
else if(xna>=50)x='D';
else x='E';
return(x);
}
#include "stdio.h"
#include "iostream.h"
char NH(double na);
double NA(int mid,int uas);
void main(){
char nama[30];char nis[8];char ket[10];
int mid,uas;double na;
cout<<"input Nilai mahasiswa :"<<endl;
cout<<"__________________________________"<<endl;
cout<<"Nis :";gets(nis);
cout<<"Nama :";gets(nama);
cout<<"Nilai mid :";cin>>mid;
cout<<"Nilai uas :";cin>>uas;
na=NA(mid,uas);
cout<<"nilai angka :"<<na<<endl;
cout<<"nilai huruf :"<<NH(na)<<endl;
if(NH(na)=='E') strcpy(ket,"gagal");
else strcpy(ket,"lulus");
cout<<"keterangan :"<<ket;
}
double NA(int mid,int uas){
return(0.4*mid+0.6*uas);
}
char NH(double xna){
char x;
if(xna>=80)x='A';
else if(xna>=70)x='B';
else if(xna>=60)x='c';
else if(xna>=50)x='D';
else x='E';
return(x);
}
0 komentar:
Posting Komentar