#include<conio.h>
#include<iostream.h>
#include<iomanip.h>
int main()
{
int i,s;
char nama[5][20];
float januari[5];
//float februari[5];
//float maret[5];
//float april[5];
//float mei[5];
//double hasil[5];
cout<<"Masukkan jumlah data: ";
cin>>s;
for(i=1;i<=s;i++)
{
cout<<"Data Ke - "<<i<<endl;
cout<<"Sales/Transaksi Bulan : "; cin>>nama[i];
cout<<"Januari : "; cin>>januari[i];
//cout<<"Februari : "; cin>>februari[i];
//cout<<"Maret : "; cin>>maret[i];
//cout<<"Apri; : "; cin>>april[i];
//cout<<"Mei : "; cin>>mei[i];
//hasil[i] = (nilai1[i] * 0.40)+ (nilai2[i] * 0.60);
cout<<endl;
}
cout<<"-----------------------------"<<endl;
cout<<"|No.Sales/Transaksi Januari |"<<endl;//<<Bulan Januari Februari Maret April Mei Total Penjualan|"<<endl;
cout<<"-----------------------------"<<endl;
for(i=1;i<=s;i++)
{
cout<<setiosflags(ios::left)<<setw(4)<<i;
cout<<setiosflags(ios::left)<<setw(10)<<nama[i];
cout<<setprecision(2)<<" "<<setw(2)<<januari[i]<<endl;
//cout<<setprecision(4)<<" "<<setw(2)<<februari[i];
//cout<<setprecision(4)<<" "<<setw(2)<<maret[i];
//cout<<setprecision(4)<<" "<<setw(2)<<april[i];
//cout<<setprecision(4)<<" "<<setw(2)<<mei[i];
//cout<<setprecision(8)<<" "<<setw(8)<<hasil[i]<<endl;
}
getch();
}
Jumat, 24 Juni 2011
srtuktur array
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar