#include<iostream.h>
#include<string.h>
#include<iomanip.h>
#include<conio.h>
struct mahasiswa
{ char nim[8];
char nama[30];
char kls[5];
int na;
};
struct mahasiswa mhs[5];
void bacarecord();
void cetakrecord();
main()
{
bacarecord();
clrscr();
cetakrecord();
return 0;
}
void bacarecord()
{
cout<<"Baca Data Record Mahasiswa"<<endl;
for (int e=0;e<5;e++)
{
cout<<"mahasiswa Ke "<<endl;
cout<<"Nim : ";cin>>mhs[e].nim;
cout<<"Nama : ";cin>>mhs[e].nama;
cout<<"Kelas : ";cin>>mhs[e].kls;
cout<<"Nilai : ";cin>>mhs[e].na;
}
}
void cetakrecord()
{
char nh;
cout<<"Baca Data Record Mahasiswa"<<endl<<endl;
for (int e=0;e<5;e++)
{
cout<<"Mahasiswa Ke "<<e+<<endl;
cout<<"Nim : ";cin>>mhs[e].nim<<endl;
cout<<"Nama : ";cin>>mhs[e].nama<<endl;
cout<<"Kelas : ";cin>>mhs[e].kls<<endl;
cout<<"Nilai : ";cin>>mhs[e].na<<endl;
if (mhs[e].na<20)
nh='E';
else if (mhs[e].na<40)
nh='D';
else if (mhs[e].na<60)
nh='C';
else if (mhs[e].na<75)
nh='B';
else
nh='A';
cout<<"Nilai Huruf : "<<nh<<endl;
}
}
Sabtu, 30 Maret 2013
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar