#include<iostream>
#include <iomanip>
using namespace std;
int main ()
{
int i,j,jumlah;
int baris, kolom, jual[10][10];
char nama[10][10];
cout<<"inputkan banyak baris : ";cin>>baris;
cout<<"inputkan banyak kolom : ";cin>>kolom;
for(i=1; i<=baris; i++)
{
cout<< "Nama Sales Ke - "<<i<<" : "; cin>>nama[i];
}
cout<<endl;
for(i=1; i<=baris; i++)
{
for(j=1; j<=kolom; j++)
{
cout<< "Data Ke - "<<i<<"."<<j<<endl ;
cout<< "Jumlah Penjualan = "; cin>>jual[i][j];
}
cout<<endl;
}
cout<<endl;
cout<< "DATA PENJUALAN"<<endl;
cout<< "--------------------";
for(j=1; j<=kolom; j++)
{
cout<<"-----";
}
cout<<"----";
cout<<endl;
cout<< "No Nama Penjualan";
for(j=1; j<=kolom; j++)
{
if(j>=2)
{
cout<<" ";
}
}
cout<< "Jumlah";
cout<<endl;
cout<< " ";
for(j=1; j<=kolom; j++)
{
cout<<j<<" ";
}
cout<<endl;
cout<< "--------------------";
for(j=1; j<=kolom; j++)
{
cout<<"-----";
}
cout<<"----";
cout<<endl;
for(i=1; i<=baris; i++)
{
cout<<setiosflags(ios::left)<<setw(7)<<i;
cout<<setiosflags(ios::left)<<setw(10)<<nama[i];
jumlah=0;
for(j=1; j<=kolom; j++)
{
cout<<setiosflags(ios::left)<<setw(2);
cout<<jual[i][j]<<" ";
jumlah=jumlah+jual[i][j];
}
cout<<setiosflags(ios::left)<<setw(8)<<jumlah;
cout<<endl;
}
cout<< "--------------------";
for(j=1; j<=kolom; j++)
{
cout<<"-----";
}
cout<<"----";
cout<<endl;
return 0;
}
#include <iomanip>
using namespace std;
int main ()
{
int i,j,jumlah;
int baris, kolom, jual[10][10];
char nama[10][10];
cout<<"inputkan banyak baris : ";cin>>baris;
cout<<"inputkan banyak kolom : ";cin>>kolom;
for(i=1; i<=baris; i++)
{
cout<< "Nama Sales Ke - "<<i<<" : "; cin>>nama[i];
}
cout<<endl;
for(i=1; i<=baris; i++)
{
for(j=1; j<=kolom; j++)
{
cout<< "Data Ke - "<<i<<"."<<j<<endl ;
cout<< "Jumlah Penjualan = "; cin>>jual[i][j];
}
cout<<endl;
}
cout<<endl;
cout<< "DATA PENJUALAN"<<endl;
cout<< "--------------------";
for(j=1; j<=kolom; j++)
{
cout<<"-----";
}
cout<<"----";
cout<<endl;
cout<< "No Nama Penjualan";
for(j=1; j<=kolom; j++)
{
if(j>=2)
{
cout<<" ";
}
}
cout<< "Jumlah";
cout<<endl;
cout<< " ";
for(j=1; j<=kolom; j++)
{
cout<<j<<" ";
}
cout<<endl;
cout<< "--------------------";
for(j=1; j<=kolom; j++)
{
cout<<"-----";
}
cout<<"----";
cout<<endl;
for(i=1; i<=baris; i++)
{
cout<<setiosflags(ios::left)<<setw(7)<<i;
cout<<setiosflags(ios::left)<<setw(10)<<nama[i];
jumlah=0;
for(j=1; j<=kolom; j++)
{
cout<<setiosflags(ios::left)<<setw(2);
cout<<jual[i][j]<<" ";
jumlah=jumlah+jual[i][j];
}
cout<<setiosflags(ios::left)<<setw(8)<<jumlah;
cout<<endl;
}
cout<< "--------------------";
for(j=1; j<=kolom; j++)
{
cout<<"-----";
}
cout<<"----";
cout<<endl;
return 0;
}
Comments
Post a Comment