This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Friday, June 28, 2013

menghitung upah karyawan dengan C++

#include<iostream>
#include<string>
#include<math.h>
#include<conio.h>
using namespace std;
int main()
{
    char gol;
    string nama;
    int upahnormal,jamkerja,jamlembur, upahlembur,totalgaji;
    //upahlembur=3000;
        cout<<endl;
    cout<<" Masukan Nama Karyawan : " ;    getline(cin,nama) ;
cout<<" Masukan Golongan       : " ;
cin>>gol;
cout<<" Jumlah jam Kerja       : " ;
cin>>jamkerja;
cout<<"=================================" <<endl;

switch(gol){
case 'A':
case 'a':
    if (jamkerja <= 48)
    {
        jamlembur=0;
        upahnormal=jamkerja * 4000;
        upahlembur=jamlembur*3000;
        totalgaji= upahnormal+upahlembur;
    }
    else
    {
        jamlembur= jamkerja-48;
        upahnormal=48*4000;
        upahlembur=jamlembur*3000;
        totalgaji= upahnormal+upahlembur;
    }
    cout<<"Upah       :" <<upahnormal <<endl;
    cout<<"Upah lembur:" <<upahlembur <<endl;
    cout<<"===================================" <<endl;
    cout<<"Total Gaji :" <<totalgaji <<endl;
break;
case 'B':
    case 'b':
    if (jamkerja <= 48)
        upahnormal=jamkerja * 5000;
    else{
        jamlembur= jamkerja-48;
        upahnormal=48*5000;
        upahlembur=jamlembur*3000;
        totalgaji= upahnormal+upahlembur;
        }
    cout<<"Upah:" <<upahnormal <<endl;
        cout<<"Upah lembur:" <<upahlembur <<endl;
        cout<<"Total Gaji:" <<totalgaji <<endl;
break;
case 'C':
    case 'c':
if (jamkerja <= 48)
        upahnormal=jamkerja * 6000;
else {
        jamlembur= jamkerja-48;
        upahnormal=48*6000;
        upahlembur=jamlembur*3000;
        totalgaji= upahnormal+upahlembur;
        }
        cout<<"Upah:" <<upahnormal <<endl;
        cout<<"Upah lembur:" <<upahlembur <<endl;
        cout<<"Total Gaji:" <<totalgaji <<endl;
break;
case 'D':
    case 'd':
    if (jamkerja <= 48)
        upahnormal=jamkerja * 7000;
    else
    {
        jamlembur= jamkerja-48;
        upahnormal=48*7000;
        upahlembur=jamlembur*3000;
        totalgaji= upahnormal+upahlembur;
        }
        cout<<"Upah:" <<upahnormal <<endl;
        cout<<"Upah lembur:" <<upahlembur <<endl;
        cout<<"Total Gaji:" <<totalgaji <<endl;
break;



            default: cout<<"Input Golongan Salah .....!"<<endl;
                    break;
}

system ("PAUSE");
return EXIT_SUCCESS;

}