Monday, April 16, 2012
GAJI
#include <iostream.h>
#include <conio.h>
int gajikaryawan(long gaji_gross[5],int kode_pajak[5])
{
int i;
long gaji[5];
float pajak[5];
if (kode_pajak[i]=1)
{pajak[i]=0.1;}
if (kode_pajak[i]=2)
{pajak[i]=0.2;}
if (kode_pajak[i]=3)
{pajak[i]=0.3;}
gaji[i]=pajak[i]*(gaji_gross[i]);
cout<<gaji[i];
getch();
return 0;
}
int pajakkaryawan(long gaji_gross[5],int kode_pajak[5])
{
int i;
if (gaji_gross[i]<=2000000)
{kode_pajak[i]=1;}
if (gaji_gross[i]<=5000000&&gaji_gross[i]>2000000)
{kode_pajak[i]=2;}
if (gaji_gross[i]>5000000)
{kode_pajak[i]=3;}
cout<<kode_pajak[i];
getch ();
return 0;
}
int main()
{
int i;
int kode_pajak[5];
long gaji_gross[5];
char Nama[7][6];
cout<<"-------Daftar Gaji Karyawan Tahun 2010-----------\n\n";
for(i=0;i<=5;i++)
{
cout<<"Nama Karyawan =";
cin>>Nama[i];
cout<<"Gaji Bulanan =";
cin>>gaji_gross[i];
cout<<"Kode Pajak = ";
cout<<pajakkaryawan(gaji_gross,kode_pajak);
cout<<endl;
cout<<"Gaji Tahun 2010 =";
cout<<gajikaryawan(gaji_gross,kode_pajak)<<endl<<endl;
}
getch();
return 0;
}
Labels:
Algoritma dan Pemrograman
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment