jangan lupa koment ya.. & isi vottingnya. Oke..
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <iomanip.h>
line1(){textcolor(5067);cprintf("---------------------------------------------------------");}
line2(){textcolor(312);cprintf("---------------------------------------------------------");}
line3(){textcolor(12);cprintf("---------------------------------------------------------");}
long int ttl(int gaji, int upah);
double nhasil(int nluas, int nluts);
main()
{ int x,badat,row;
char lagi;
struct
{char nmburuh[20],golongan;
int jmljamkerja,gjharian,gjlembur;long int total;
}buruh[20];
int rows;
struct
{ char nmmahasiswa[20],nlhuruf;
int uts,uas;
}nilai[20];
n:
clrscr();
gotoxy(15,1);textcolor(15);
cprintf("DAFTAR NILAI MATA KULIAH C++");cout<<endl;
line1();cout<<endl;
cout<<"input banyak data mahasiswa = ";cin>>badat;cout<<endl;
for(x=1;x<=badat;x++)
{ cout<<"data mahasiswa ke- "<<x<<endl;
cout<<"masukkan nama mahasiswa : ";gets(nilai[x].nmmahasiswa);
cout<<"masukkan nialai UTS : ";cin>>nilai[x].uts;
cout<<"masukkan nialai UAS : ";cin>>nilai[x].uas;
line2();
cout<<endl;
if (nhasil(nilai[x].uas,nilai[x].uts)>=80)
nilai[x].nlhuruf='A';
else if (nhasil(nilai[x].uas,nilai[x].uts)>=70)
nilai[x].nlhuruf='B';
else if (nhasil(nilai[x].uas,nilai[x].uts)>=56)
nilai[x].nlhuruf='C';
else if (nhasil(nilai[x].uas,nilai[x].uts)>=47)
nilai[x].nlhuruf='D';
else
nilai[x].nlhuruf='E';
}
clrscr();
gotoxy(16,1);textcolor(132);
cprintf("DAFTAR NILAI MATA KULIAH C++");cout<<endl;
gotoxy(1,2);line3();
gotoxy(1,3);cout<<"NO NAMA NILAI NILAI NILAI";
gotoxy(1,4);cout<<" MAHASISWA UTS UAS AKHIR HURUF";
gotoxy(1,5);line2();
rows=6;
for (x=1;x<=badat;x++)
{
gotoxy(1,rows);cout<<x;
gotoxy(6,rows);cout<<nilai[x].nmmahasiswa;
gotoxy(22,rows);cout<<nilai[x].uts;
gotoxy(30,rows);cout<<nilai[x].uas;
gotoxy(40,rows);cout<<nhasil(nilai[x].uas,nilai[x].uts);
gotoxy(52,rows);cout<<nilai[x].nlhuruf;
rows++;
cout<<endl;
}
line1();
cout<<endl<<endl;
cout<<"input lagi ? [y/t] = ";cin>>lagi;
if (lagi=='y'||lagi=='Y')
goto n;
else
goto o;
getch();
o:
clrscr();
line1();
gotoxy(20,1);cout<<"Daftar Honor Pegawai Honorer"<<endl;
gotoxy(20,2);cout<<" PT.ALAKADARNYA"<<endl;
line2();cout<<endl;
cout<<"input data pegawai [1,2,3...] : ";cin>>badat;
line3();cout<<endl;
for (x=1;x<=badat;x++)
{ cout<<"data pegawai ke-"<<x<<endl;
cout<<"nama pegawai = ";cin>>buruh[x].nmburuh;
cout<<"golongan [A/ B/ C] = ";cin>>buruh[x].golongan;
cout<<"jumlah jam kerja = ";cin>>buruh[x].jmljamkerja;cout<<endl;
if (buruh[x].golongan=='a'||buruh[x].golongan=='A')
buruh[x].gjharian=25000;
else if (buruh[x].golongan=='b'||buruh[x].golongan=='B')
buruh[x].gjharian=15000;
else
buruh[x].gjharian=10000;
if (buruh[x].jmljamkerja>8)
buruh[x].gjlembur=(buruh[x].jmljamkerja-8)*5000;
else
{buruh[x].gjharian=(buruh[x].gjharian/8)*buruh[x].jmljamkerja;
buruh[x].gjlembur=0;}
line1();cout<<endl;
line2();cout<<endl;
}
clrscr();
gotoxy(20,1);cout<<"Daftar Honor Pegawai Honorer";
gotoxy(20,2);cout<<" PT.ALAKADARNYA";
gotoxy(1,3);line1();
gotoxy(1,4);cout<<"NO NAMA GOLONGAN GAJI GAJI JUMLAH";
gotoxy(1,5);cout<<" PEGAWAI & JAM KERJA HARIAN LEMBUR HONOR";
gotoxy(1,6);line3();
row=7;
for (x=1;x<=badat;x++)
{
gotoxy(1,row);cout<<x<<endl;
gotoxy(5,row);cout<<buruh[x].nmburuh;
gotoxy(19,row);cout<<buruh[x].golongan;cout<<buruh[x].jmljamkerja;
gotoxy(28,row);cout<<buruh[x].gjharian;
gotoxy(37,row);cout<<buruh[x].gjlembur;
gotoxy(46,row);cout<<ttl(buruh[x].gjharian ,buruh[x].gjlembur);
row++;
}
cout<<endl;
gotoxy(1,row);line1();cout<<endl;
cout<<"input lagi ? [y/t] = ";cin>>lagi;
if (lagi=='y'||lagi=='Y')
{textcolor(3);cprintf("input data 1 : nilai mahasiswa");cout<<endl;
textcolor(3);cprintf(" data 2 : data buruh\n ");cout<<endl;
textcolor(87);cprintf("masukkan pilihan data anda [ 1 atau 2] = ");cin>>lagi;
if (lagi=='1')
goto n;
else
goto o;}
else
goto m;
getch();
m:
}
long int ttl(int gaji, int upah)
{ return (gaji+upah);
}
double nhasil(int nluas,int nluts)
{return (nluas*0.4)+(nluts*0.6);}
Tidak ada komentar:
Posting Komentar
Berkomentar lah dengan kritik dan saran yg BIJAK
sesuai dan beradab,
*:::_Bahasa Menggambarkan Bangsa_::*