MENGHITUNG GAJI KARYAWAN DENDAN C++ SWITCH CASE
pelajari seksama jangan hanya copas,,,,,,,,,, sob,,,,,
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
int main()
{
char yes;
yes='y';
while(yes=='y')
{
cout<<" "<<endl;
cout<<" * Menghitung Gaji * "<<endl<<endl;
cout<<"**********************************************************************"<<endl<<endl;
int a,manager,karyawan,ass;
int gm = 200000,gk=100000, gass=900000;
int angka;
cout<<"1.Gaji Manager "<<endl;
cout<<"2.Gaji Asisten Manager "<<endl;
cout<<"3.Gaji Sekretaris "<<endl;
cout<<"4.Gaji karyawan "<<endl;
cout<<"3.Tunjangan Jabatan "<<endl;
cout<<" Masukkan pilihan anda = ";cin>>a;
cout<<" Masukkan hari masuk anda = ";cin>>angka;
cout<<"**********************************************************************"<<endl;
switch(a)
{
case 1 :
manager=gm*angka;
cout<<"jumlah gaji manager = Rp. "<<manager<<endl<<endl;
break;
case 2:
ass=gass*angka;
cout<<" jumlah Gaji asisten manager = Rp. "<<ass<<endl<<endl;
case 3:
karyawan=gk*angka;
cout<<"jumlah gaji karyawan = Rp. ";
cout<<karyawan<<endl;
break;
defalt:
}
exit:
cout<<" Tekan Enter untuk halaman selanjutnya "<<endl;
getch();
clrscr();
cout<<" Anda Mau Input data lagi ?"<<endl;
cout<<"tekan (y/t) untuk kembali ke awal : ";cin>>yes;
clrscr();
}
cout<<" Terimakasih Anda telah berkunjung "<<endl;
cout<<" By : Cah Dabloeng "<<endl;
cout<<" *______________________*"<<endl<<endl;
cout<<" tekan Enter untuk keluar ";
getche();
}
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
int main()
{
char yes;
yes='y';
while(yes=='y')
{
cout<<" "<<endl;
cout<<" * Menghitung Gaji * "<<endl<<endl;
cout<<"**********************************************************************"<<endl<<endl;
int a,manager,karyawan,ass;
int gm = 200000,gk=100000, gass=900000;
int angka;
cout<<"1.Gaji Manager "<<endl;
cout<<"2.Gaji Asisten Manager "<<endl;
cout<<"3.Gaji Sekretaris "<<endl;
cout<<"4.Gaji karyawan "<<endl;
cout<<"3.Tunjangan Jabatan "<<endl;
cout<<" Masukkan pilihan anda = ";cin>>a;
cout<<" Masukkan hari masuk anda = ";cin>>angka;
cout<<"**********************************************************************"<<endl;
switch(a)
{
case 1 :
manager=gm*angka;
cout<<"jumlah gaji manager = Rp. "<<manager<<endl<<endl;
break;
case 2:
ass=gass*angka;
cout<<" jumlah Gaji asisten manager = Rp. "<<ass<<endl<<endl;
case 3:
karyawan=gk*angka;
cout<<"jumlah gaji karyawan = Rp. ";
cout<<karyawan<<endl;
break;
defalt:
}
exit:
cout<<" Tekan Enter untuk halaman selanjutnya "<<endl;
getch();
clrscr();
cout<<" Anda Mau Input data lagi ?"<<endl;
cout<<"tekan (y/t) untuk kembali ke awal : ";cin>>yes;
clrscr();
}
cout<<" Terimakasih Anda telah berkunjung "<<endl;
cout<<" By : Cah Dabloeng "<<endl;
cout<<" *______________________*"<<endl<<endl;
cout<<" tekan Enter untuk keluar ";
getche();
}