Uploaded by fname8181

CODE BLOCKS TUGAS BESAR

advertisement
#include <iostream>
using namespace std;
string nama_sales[100],nama_bonus[50],nama_komisi[50];
int
hasil_penjualan[100],gaji_diterima[100],jumlah_sales,total_penjualan,total_gaji,total_bonus,total_komi
si,i,gaji_pokok[100];
int komisi[100],bonus[100];
int main(){
cout<<"============================="<<endl;
cout<<"==PROGRAM HITUNG GAJI SALES=="<<endl;
cout<<"============================="<<endl;
cout<<"Masukan jumlah sales"<<endl;
cin>> jumlah_sales;
cout<<"============================="<<endl;
for (i=1;i<=jumlah_sales;i++){
cout<<"Masukan Nama Sales "<< i <<endl;
cin>>nama_sales[i];
cout<<"Masukan Gaji Pokok"<<endl;
cin>>gaji_pokok[i];
cout<<"Masukan Hasil Penjualan"<<endl;
cin>>hasil_penjualan[i];
cout<<"============================="<<endl;
if (hasil_penjualan[i] > 75000000) {
bonus[i] = 0.5*hasil_penjualan[i];
komisi[i] = 0*hasil_penjualan[i];
nama_bonus[i] = "5%";
nama_komisi[i] = "12%";
} else if (hasil_penjualan[i] >= 50000000) {
bonus[i] = 0*hasil_penjualan[i];
komisi[i] = 0.12*
hasil_penjualan[i];
nama_bonus[i] = "0%";
nama_komisi[i] = "12%";
} else if (hasil_penjualan[i] < 50000000) {
bonus[i] = 0*hasil_penjualan[i];
komisi[i] = 0.08*hasil_penjualan[i];
nama_bonus[i] = "0%";
nama_komisi[i] = "8%";
}
gaji_diterima[i] = gaji_pokok[i]+komisi[i]+bonus[i];
total_penjualan += hasil_penjualan[i];
total_bonus += bonus[i];
total_komisi += komisi[i];
total_gaji += gaji_diterima[i];
}
cout<<"======================================"<<endl;
cout<<"==============DATA SALES=============="<<endl;
cout<<"======================================"<<endl;
for (i=1;i<=jumlah_sales;i++){
cout << "Nama Sales "<<i<<endl;
cout << nama_sales[i]<<endl;
cout << "Hasil Penjualan"<<i<<endl;
cout << hasil_penjualan[i]<<endl;
cout << "Bonus"<<i<<endl;
cout << nama_bonus[i] <<endl;
cout << "Komisi"<<i<<endl;
cout << nama_komisi[i]<<endl;
cout << "Gaji Diterima"<<i<<endl;
cout << "Rp. "<<gaji_diterima[i]<<endl;
cout<<"======================================"<<endl;
}
cout<<""<<endl;
cout<<"======================================"<<endl;
cout<<"==PENGELUARAN PERUSAHAAN UNTUK SALES=="<<endl;
cout<<"======================================"<<endl;
cout<<"Total Penjualan"<<endl;
cout << "Rp. "<<total_penjualan<<endl;
cout<<"Total Bonus"<<endl;
cout << "Rp. "<<total_bonus<<endl;
cout<<"Total Komisi"<<endl;
cout << "Rp. "<<total_komisi<<endl;
cout<<"Total Gaji"<<endl;
cout << "Rp. "<<total_gaji<<endl;
}
Download