Minggu, 17 Januari 2010

Procedure Data Mahasiswa Di C++

//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 :"< cout<<"\nNIM mhs ke :"< cout<<"\nNilai tgs :"< cout<<"\nNilai UTS :"< cout<<"\nNilai UAS :"< cout<<"\nNilai IP :"< }
} while (toupper (p)=='y');
}

}

0 comments:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Enter your email address to subscribe:

Delivered by FeedBurner

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo