RSS

contoh program c++ menghitung gaji menggunakan case

04 May

#include
#include
#include
main () {
float gaji_pokok,gaji_bersih,tun_anak ;
float tun_jab ;
int anak;
char gol ;
cout << "PROGRAM PENGHITUNG GAJI PEGAWAI" << endl ;
cout <> gaji_pokok ;
cout <> gol ;
cout <> anak ;
switch(gol)
{
case ‘A’ :
tun_jab = 0.25 * gaji_pokok ; break ;
case ‘B’ :
tun_jab = 0.2 * gaji_pokok ; break ;
case ‘C’ :
tun_jab = 0.15 * gaji_pokok ; break ;
}
if (anak > 3){
tun_anak = 0.05 * gaji_pokok * 3 ; }
else {
tun_anak = 0.05 * gaji_pokok * anak ; }
//menghitung gaji bersih
gaji_bersih = gaji_pokok + tun_anak + tun_jab ;
cout << "Gaji Bersih Anda Adalah : " << setprecision(2)<<setiosflags(ios::fixed) << gaji_bersih ;
getch() ;
}

About these ads
 

Tags:

4 responses to “contoh program c++ menghitung gaji menggunakan case

  1. farizal

    October 30, 2010 at 8:38 am

    Thanks y

     
  2. richi hidayat

    April 26, 2011 at 12:02 am

    salah bagai mana maksud anda…?????

     
  3. richi hidayat

    April 26, 2011 at 12:02 am

    yes

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: