#include<iostream>
#include<conio>
#include<stdio>
#include<iomanip>
tunjangan(int *gol,char *jab[10],long *tunj)
{
if (*gol==1)
{
*jab="adm";
*tunj=200000;
}
else if (*gol==2)
{
*jab="staf";
*tunj=300000;
}
else if (*gol==3)
{
*jab="manager";
*tunj=500000;
}
}
garis()
{cout<<"==============================\n";}
main()
{
int
i,j,gol[4],jum[4]; char *jab[4]; long tunj[4],tot[4];
struct
{
long gapok,gaber;
}hitgaji[4];
cout<<"jumlah
data:";cin>>j;
for(i=1;i<=j;i++)
{
cout<<"data ke "<<i<<endl;
cout<<"input
gol: ";cin>>gol[i];
cout<<"input jumlah ank: ";cin>>jum[i];
cout<<"input gaji pokok: ";cin>>hitgaji[i].gapok;
tunjangan(&gol[i],&jab[i],&tunj[i]);
}
clrscr();
garis();
cout<<"no
gol anak jabatan tunj
total gapok
gaber"<<endl;
garis();
for(i=1;i<=j;i++)
{
cout<<setiosflags(ios::left);
cout<<setw(2)<<i;
cout<<setw(4)<<gol[i];
cout<<setw(4)<<jum[i];
cout<<setw(10)<<jab[i];
cout<<setw(15)<<tunj[i];
tot[i]=tunj[i]*jum[i];
cout<<setw(15)<<tot[i];
cout<<setw(15)<<hitgaji[i].gapok;
hitgaji[i].gaber=hitgaji[i].gapok + tot[i];
cout<<setw(15)<<hitgaji[i].gaber<<endl;
}
garis();
getch();
}