#include iostream.h>
#include conio.h>
void main()
{
typedef struct {
char nim[10];
char nama[30];
int tgs, uts, uas;
double na;
}idmhs;
idmhs mhs[50];
int i,n;
cout<<"Masukkan banyak mahasiswa : ";
cin>>n;
cout<<"\n==================================================";
cout<<"\n| NIM | Nama | TGS | UTS | UAS | NA |";
cout<<"\n--------------------------------------------------";
int y=6;
for (i=0;i
gotoxy(1,y); cout<<"|";
gotoxy(11,y); cout<<"|";
gotoxy(27,y); cout<<"|";
gotoxy(33,y); cout<<"|";
gotoxy(39,y); cout<<"|";
gotoxy(45,y); cout<<"|";
gotoxy(50,y); cout<<"|";
gotoxy(1,(n+6));
cout<<"==================================================\n";
y++;
}
y=6;
for (i=0;i
gotoxy(2,y);
cin>>mhs[i].nim;
gotoxy(12,y);
cin>>mhs[i].nama;
gotoxy(28,y);
cin>>mhs[i].tgs;
gotoxy(34,y);
cin>>mhs[i].uts;
gotoxy(40,y);
cin>>mhs[i].uas;
mhs[i].na = (mhs[i].tgs + 2*mhs[i].uts + 4*mhs[i].uas)/7;
gotoxy(46,y);
cout<
}
idmhs temp;
int j;
for (i=1;i<=n;i++)
{
for (j=n;j>=1;j--)
{
if (mhs[j].na > mhs[j-1].na)
{
//Menukar nilai
temp=mhs[j];
mhs[j]=mhs[j-1];
mhs[j-1]=temp;
}
}
}
clrscr();
cout<<"\n===========================================================";
cout<<"\n| NIM | Nama | TGS | UTS | UAS | NA |Rangking|";
cout<<"\n-----------------------------------------------------------";
int r =1;
y=5;
for (i=0;i
gotoxy(1,y); cout<<"|";
gotoxy(11,y); cout<<"|";
gotoxy(27,y); cout<<"|";
gotoxy(33,y); cout<<"|";
gotoxy(39,y); cout<<"|";
gotoxy(45,y); cout<<"|";
gotoxy(50,y); cout<<"|";
gotoxy(59,y); cout<<"|";
gotoxy(2,y);
cout<
cout<
cout<
cout<
cout<
cout<
cout<
cout<<"===========================================================\n";
y++;
r++;
}
/*for (i=0;i
cout<<"\nMahasiswa ke-"< cout<<"\nNim : "<
getch();
}
Label
- Adekdik Software (1)
- Aplikasi Iseng (16)
- C++ (7)
- Download (2)
- Excel (1)
- Google Map (1)
- Iseng (1)
- Nambah ilmu (32)
- Pascal (20)
- Super Iseng (2)
- VB .Net (21)
- VB 6 (1)
Selasa, 25 November 2008
Mencari ranking
Label: C++
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar