Wy22’s Weblog

Just another WordPress.com weblog

Program Upah Lembur(C++)

#include<stdio.h>
#include<conio.h>
main()
{
 char nik[8],nama[20];
   long jk,ll,uh,ul,um,ut,gb;
   textcolor(12);
   textbackground(7);
   gotoxy(15, 5);cprintf(“Entri Data Gaji Karyawan”);
   gotoxy(10, 6);printf(“=====================================================”);
   gotoxy(10, 8);printf(“Nomor Induk Karyawan = “);
   gotoxy(10, 9);printf(“Nama Karyawan        = “);
   gotoxy(10,10);printf(“Jam Kerja            = “);
   gotoxy(10,11);printf(“=====================================================”);
   gotoxy(15,12);printf(“Lama Lembur         = “);
   gotoxy(15,13);printf(“Uang Harian         = “);
   gotoxy(15,14);printf(“Uang Lembur         = “);
   gotoxy(15,15);printf(“Uang Makan          = “);
   gotoxy(15,16);printf(“Uang Transportasi   = “);
   gotoxy(15,17);printf(“Gaji Bersih         = “);
   gotoxy(10,18);printf(“=====================================================”);
   gotoxy(33, 8);cscanf(“%s”,&nik);
   gotoxy(33, 9);scanf(“%s”,nama);
   gotoxy(33,10);scanf(“%d”,&jk);
   if (jk > 8)
   {
    ll = jk – 8;
      uh = 32000;
      ul = ll * 7000;
      if (jk > 9)
       um = 10000;
      else
       um = 0;
      if (jk >= 11)
       ut = 8000;
      else
       ut = 0;
   }
   else
   {
  ll = 0;
      uh = jk * 4000;
      ul = 0;
      um = 0;
      ut = 0;
   }
   gb = uh + ul + um + ut;
   textcolor(9);
   gotoxy(37,12);cprintf(“%6d\n”,ll);
   gotoxy(37,13);cprintf(“%6d\n”,uh);
   gotoxy(37,14);cprintf(“%6d\n”,ul);
   gotoxy(37,15);cprintf(“%6d\n”,um);
   gotoxy(37,16);cprintf(“%6d\n”,ut);
   textcolor(13);
   gotoxy(37,17);cprintf(“%6d\n”,gb);
   getch();
   getch();
}

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: