//procedur data kemahasiswaan
void mhs(int jum){
struct data{
char nim[8];
char nama[30];
float IP;
float tugas;
float uts;
float uas;
}mhs[10],temp;
char p='y';
for (int i=1; i<=jum; i++){
cout<<"Data mahasiswa ke "<>mhs[i].nama;
cout<<"Masukan NIM mhs :";cin>>mhs[i].nim;
cout<<"Masukan nilai tgs :";cin>>mhs[i].tugas;
cout<<"Masukan nilai UTS :";cin>>mhs[i].uts;
cout<<"Masukan nilai UAS :";cin>>mhs[i].uas;
mhs[i].IP= (mhs[i].tugas + (2*mhs[i].uts)+ (3*mhs[i].uas))/6;
}
clrscr();
for (int i=1; i<=jum; i++){
cout<<"\nData mahasiswa ke "<=i+1; j--){
if (mhs[i].IP>=mhs[j].IP){
temp = mhs[i];
mhs[i] = mhs[j];
mhs[j] = temp;
}
}
}
if (jum>2){
do{
cout<<"\nUrutkan berdasarkan IP ? (y/t) :";
cin>>p;
cout<<"\nData setelah di urut :";
for (int i=1; i<=jum; i++){
cout<<"\nData mahasiswa ke "<
cout<<"Nama mhs :"<
} while (toupper (p)=='y');
}
}
Minggu, 17 Januari 2010
Procedure Data Mahasiswa Di C++
Minggu, Januari 17, 2010
Galiarta
No comments
0 comments:
Posting Komentar