Advertisement
Guest User

bb

a guest
Oct 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. main()
  6. {
  7. int a, b, toga, lagi;
  8. char golongan[3] = {'1','2','3'} ,*ket[3], nama[5][20];
  9. long hotap[3], jumkar[3], jamker[3], tunja[3];
  10. long holem[3], penber[3];
  11. double pajak[3], pentor[3];
  12.  
  13. atas:
  14. system("cls");
  15.  
  16. cout<<"Program Hitung Honor Karyawan Kontrak"<<endl;
  17. cout<<"PT. BONAFIT"<<endl;
  18. cout<<endl;
  19. cout<<"Masukkan Jumlah Karyawan : ";cin>>a;
  20. jumkar[a] = 0;
  21. if (a <= 0)
  22. {
  23. cout<<endl<<"\t\tJumlah Karyawan Tidak Boleh Null";
  24. goto bawah;
  25. }
  26. else
  27. {
  28. for(b = 1 ; b <= a; ++b)
  29. {
  30. cout<<"Karyawan Ke - "<<b<<endl;
  31. cout<<"Nama Karyawan : ";cin>>(nama[b]);
  32. cout<<"Jenis Golongan [1/2/3] : ";cin>>golongan[b];
  33. cout<<"Jumlah Jam Kerja : ";cin>>jamker[b];
  34. cout<<endl;
  35. hotap[a]=700000;
  36. if (golongan[b] == '1' || golongan[b] == '1')
  37. {
  38. ket[b] = "Golongan 1";
  39. tunja[b] = hotap[a] * 0.05;
  40. }
  41. else if (golongan[b] == '2' || golongan[b] == '2')
  42. {
  43. ket[b] = "Golongan 2";
  44. tunja[b] = hotap[a] * 0.1;
  45. }
  46. else if (golongan[b] == '3' || golongan[b] == '3')
  47. {
  48. ket[b] = "Golongan 3";
  49. tunja[b] = hotap[a] * 0.15;
  50. }
  51. else
  52. {
  53. cout<<"Anda Salah Masukan Kode Jenis Golongan."<<endl;
  54. tunja[b] = 0;
  55. }
  56. holem[b] = 2500*(jamker[b] - 240);
  57. pentor[b] = hotap[b] + tunja[b] + holem[b];
  58. penber[b] = pentor[b] - pajak[b];
  59. penber[a] = pentor[b] - pajak[b];
  60. pajak[b] = pentor[b] * 0.1;
  61.  
  62. }
  63. }
  64. cout<<endl;
  65. cout<<"\t\t\tPT. BONAFIT"<<endl;
  66. cout<<endl;
  67. cout<<"------------------------------------------------------------------------"<<endl;
  68. cout<<" No. Nama Tunjangan\t Honor Pajak Pendapatan"<<endl;
  69. cout<<" Karyawan Jabatan\t Lembur Bersih"<<endl;
  70. cout<<"------------------------------------------------------------------------"<<endl;
  71. for (b = 1; b <= a; ++b)
  72. {
  73. cout<<" "<<b<<"\t"<<nama[b]<<" "<<tunja[b];
  74. cout<<" "<<holem[b]<<" "<<pajak[b]<<" "<<penber[b]<<endl;
  75.  
  76. }
  77. cout<<"------------------------------------------------------------------------"<<endl;
  78. toga = penber[b] + penber[a];
  79. cout<<"\t\t Total Gaji Yang Dikeluarkan Rp "<<toga;
  80. cout<<endl;
  81. cout<<endl<<"\tCek Lagi? [Y/T] = ";
  82. lagi = getche();
  83. if (lagi == 'Y' || lagi == 'y')
  84. goto atas;
  85. else
  86. cout<<endl<<"\t\tTerima Kasih"<<endl;
  87. bawah:
  88. getch();
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement