#include<conio.h>
#include<stdio.h>
#include<iostream.h>
#include<iomanip.h>
main( )
{
int i;
char nama[5][20],nim[5][10];
int nilai1[5],nilai2[5],nilai3[5],nrata[5],jumdat;
clrscr( );
cout<<"Masukkan Jumlah Data : ";cin>>jumdat;
for(i=1;i<=jumdat;i++)
{
cout<<"Data Ke - "<<i<<endl;
cout<<"Masukkan NIM : ";cin>>nim[i];
cout<<"Masukkan Nama : ";cin>>nama[i];
cout<<"Masukkan Nilai1 : ";cin>>nilai1[i];
cout<<"Masukkan Nilai2 : ";cin>>nilai2[i];
cout<<"Masukkan Nilai3 : ";cin>>nilai3[i];
nrata[i] = (nilai1[i] * 0.20)+ (nilai2[i] * 0.50)+(nilai3[i]*0.30);
cout<<endl;
}
cout<<"----------------------------------------------------------"<<endl;
cout<<"No. NIM Nama Nilai Nilai Nilai Nilai"<<endl;
cout<<"\t Mahasiswa\tI \tII\t III\t Rata2"<<endl;
cout<<"----------------------------------------------------------"<<endl;
for(i=1;i<=jumdat;i++)
{
cout<<setiosflags(ios::left)<<setw(4)<<i;
cout<<setiosflags(ios::left)<<setw(10)<<nim[i];
cout<<setiosflags(ios::left)<<setw(10)<<nama[i];
cout<<setiosflags(ios::left)<<setw(10)<<nilai1[i];
cout<<setiosflags(ios::left)<<setw(10)<<nilai2[i];
cout<<setiosflags(ios::left)<<setw(10)<<nilai3[i];
cout<<setiosflags(ios::left)<<setw(6)<<nrata[i]<<endl;
}
cout<<"----------------------------------------------------------"<<endl;
getch();
}
0 comments:
Post a Comment