#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int jumlah,isi,kolom,i,j,k,tugas1[30][30][30];
float rata;
char nama[20][20];
cout<< "Masukkan Jumlah Mahasiswa = "; cin>>jumlah;
cout<< "Inputkan Banyak Semester = "; cin>>isi;
cout<< "inputkan banyak Tugas = "; cin>>kolom;
cout<<endl;
for(i=1; i<=jumlah; i++)
{
cout<< "Masukkan Nama : "; cin>>nama[i];
for(j=1; j<=isi; j++)
{
cout<< "Semester ke- "<<j<<endl;
for(k=1; k<=kolom; k++)
{
cout<< "Nilai Tugas "<<k<<" = "; cin>>tugas1[i][j][k];
}
cout<<endl;
}
cout<<endl;
}
cout<< endl;
cout<< "TABEL NILAI MAHASISWA"<<endl;
cout<< "------------------------";
for(k=1; k<=kolom; k++)
{
cout<< "---------";
}
cout<< "-------";
cout<<endl;
cout<< "No Nama Semester ";
for(k=1; k<=kolom; k++)
{
cout<< "Tugas "<<k<<" ";
}
cout<< "Rata2";
cout<<endl;
cout<< "------------------------";
for(k=1; k<=kolom; k++)
{
cout<< "---------";
}
cout<< "-------";
cout<<endl;
for(i=1; i<=jumlah; i++)
{
for(j=1; j<=isi; j++)
{
float rata=0;
cout<<setiosflags(ios::left)<<setw(7)<<i;
cout<<setiosflags(ios::left)<<setw(12)<<nama[i];
cout<<setiosflags(ios::left)<<setw(9)<<j;
for(k=1; k<=kolom; k++)
{
cout<<setiosflags(ios::left)<<setw(9)<<tugas1[i][j][k];
rata=(rata+tugas1[i][j][k]);
}
rata=rata/kolom;
cout<<setiosflags(ios::left)<<setw(9)<<rata;
cout<<endl;
}
cout<<endl;
}
return 0;
}
#include<iomanip>
using namespace std;
int main()
{
int jumlah,isi,kolom,i,j,k,tugas1[30][30][30];
float rata;
char nama[20][20];
cout<< "Masukkan Jumlah Mahasiswa = "; cin>>jumlah;
cout<< "Inputkan Banyak Semester = "; cin>>isi;
cout<< "inputkan banyak Tugas = "; cin>>kolom;
cout<<endl;
for(i=1; i<=jumlah; i++)
{
cout<< "Masukkan Nama : "; cin>>nama[i];
for(j=1; j<=isi; j++)
{
cout<< "Semester ke- "<<j<<endl;
for(k=1; k<=kolom; k++)
{
cout<< "Nilai Tugas "<<k<<" = "; cin>>tugas1[i][j][k];
}
cout<<endl;
}
cout<<endl;
}
cout<< endl;
cout<< "TABEL NILAI MAHASISWA"<<endl;
cout<< "------------------------";
for(k=1; k<=kolom; k++)
{
cout<< "---------";
}
cout<< "-------";
cout<<endl;
cout<< "No Nama Semester ";
for(k=1; k<=kolom; k++)
{
cout<< "Tugas "<<k<<" ";
}
cout<< "Rata2";
cout<<endl;
cout<< "------------------------";
for(k=1; k<=kolom; k++)
{
cout<< "---------";
}
cout<< "-------";
cout<<endl;
for(i=1; i<=jumlah; i++)
{
for(j=1; j<=isi; j++)
{
float rata=0;
cout<<setiosflags(ios::left)<<setw(7)<<i;
cout<<setiosflags(ios::left)<<setw(12)<<nama[i];
cout<<setiosflags(ios::left)<<setw(9)<<j;
for(k=1; k<=kolom; k++)
{
cout<<setiosflags(ios::left)<<setw(9)<<tugas1[i][j][k];
rata=(rata+tugas1[i][j][k]);
}
rata=rata/kolom;
cout<<setiosflags(ios::left)<<setw(9)<<rata;
cout<<endl;
}
cout<<endl;
}
return 0;
}
Comments
Post a Comment