Wednesday, October 14, 2015

C++ NOMOR 10

1. Input an employee's number, pay rate and the number of hours worked in a week. The program is
then to compute the employee's weekly pay and print it along with the input data. According to the company's rule, no employee may be paid for more than 60 hours per week, and the maximum hourly rate is $25.00 perhour. If more than 35 hours are worked, then payment for the overtime hours worked is calculated at time and a half. If the hours worked field or the hourly rate field is out of range. then the input data and an appropiate message is to be printed and the employee's weekly pay is not to be calculated.

#include <iostream>
#include <conio.h>
using namespace std;
main()
{
      float JJKM, NP, GJ, THP, LBR, OT, OTP;
      cout<<"Masukkan Nomor Pegawai = ";
      cin>>NP;
      cout<<"Masukkan Jumlah Jam Kerja Selama Seminggu = ";
      cin>>JJKM;
      cout<<"Gaji per Jam = ";
      cin>>GJ;
      cout<<"\n++++++++Perhitungan Gaji dalam Dollar $+++++++++++++++++++++++\n";
      if (GJ > 25)
      {cout<<"\nInput Gaji per Jam melebihi ketentuan Perusahaan\n";}
      else if (JJKM > 60)
      {cout<<"\nInput Jumlah Jam Perminggu melebihi ketentuan Perusahaan";}
      else if (JJKM <= 35)
      {THP = GJ*JJKM;
      cout<<"\nPerhitungan Gaji perhitungan Normal\n"<<THP;}
      else
      {OT = JJKM - 35;
      OTP = OT*GJ*1.5;
      THP = (GJ*35)+OTP;
      cout<<"\nPerhitungan Gaji dengan LEMBUR\n"<<THP;}
      getch();

}

No comments:

Post a Comment