Setelah sebelumnya saya sudah membagikan Program Kalkulator Sederhana , nah.. sekarang saya akan membagikan contoh program sederhana menghitung gaji..
Langsung saja code nya seperti berikut..
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
main ()
{
cout<<"Program Menghitung Gaji"<<endl;
cout<<"Created By Putra Mahayana"<<endl;
cout<<"http://infinite-true-story.blogspot.com"<<endl;
cout<<"======================================="<<endl;
float a,b,c,d;
printf("Aplikasi Penghitungan Gaji Pegawai");
printf("\n=======================================");
printf("\n");
awal:
printf ("Nama Pegawai: ") ; scanf ("%s", &d);
printf("\n Masukkan Jumlah Gaji Pokok : ");scanf("%f",&a);
printf("\n Masukkan Jumlah Tunjangan : ");scanf("%f",&b);
printf("\n=======================================");
c=a+b;
printf("\n Jumlah Total Gaji (gaji kotor) : %.f",c);
d=(c*20)/100;
printf("\n PPh 20 persen : %.3f",d);
printf("\n Gaji Setalah Potong PPh (gaji bersih): %.3f",c-d);
printf("\n=======================================\n");
{cout<<"Mengulang : [Y/N] ? " ;
char m ;
cin>>m;
if (m == 'Y')
goto awal ;
else if (m == 'N')
{
cout<<"\n\nhttp://infinite-true-story.blogspot.com";}
getch ();
return 0;
}}
Semoga bermanfaat sob ^^
{ 0 komentar... read them below or add one }
Posting Komentar