Fish

Selasa, 29 Januari 2013

program gaji c++

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
char nama[20],golongan[5],pendidikan[12];
int tj,tp,hl,tot,jml;
puts("\t\t PROGRAM HITUNGAN GAJI KARYAWAN");
puts("\t===========================================");
cout<<"Nama karyawan             :";cin>>nama;
cout<<"Golongan jabatan         :";cin>>golongan;
cout<<"Pendidikan            :";cin>>pendidikan;
cout<<"Jumlah jam kerja        :";cin>>jml;
clrscr();
cout<<"Karyawan yang bernama          :"<<nama<<endl;
cout<<"Honor yang diterima        :"<<endl;
if
(strcmp(golongan,"1")==0)
{
tj=0.05*300000;
}
  else if (strcpy(golongan,"2")==0)
{
tj=0.1*300000;
}
  else if (strcpy(golongan,"3")==0)
{
tj=0.15*300000;
}
else
cout<<"golongan salah"<<endl;
cout<<"tunjangan jabatan        :Rp"<<tj<<endl;
 if
(strcmp(pendidikan,"sma")==0||strcmp(pendidikan,"SMA")==0)
{
tp=0,025*300000;
}
else if(strcmp(pendidikan,"d1")==0||strcmp(pendidikan,"D1")==0)
{
tp=0.05*300000;
}
else if(strcmp(pendidikan,"d3")==0||strcmp(pendidikan,"D3")==0)
{
tp=0.3*300000;
}
else
cout<<"pendidikan salah"<<endl;
cout<<"tunjangan pendidikan        :Rp"<<tp<<endl;
if(jml>8)
{
hl=(jml-8)*3500;
}
else
{
hl=0;
}
cout<<"honor lembur            :Rp"<<hl<<endl;
tot=300000+tj+tp+hl;
cout<<"total gaji              :Rp"<<tot<<endl;
getch();
}

Tidak ada komentar:

Poskan Komentar