Borland C++ Tipe E


#include<stdio.h>
#include<iomanip.h>
#include<iostream.h>
#include<conio.h>
char *nama(char nip[9])
{
if(!strcmp(nip,”13540121″))
{return “Eva Melinda, S.Kom”;}
else if(!strcmp(nip,”13540424″))
{return “Ade Hendini, S.Kom”;}
else if(!strcmp(nip,”13540488″))
{return “Deni Maulana, ST”;}
else if(!strcmp(nip,”13540773″))
{return “Abduyl Majid, S.Si”;}
else if(!strcmp(nip,”13540999″))
{return “Desy R. Sari, M.Msi”;}
}

char *gol(char nip[8])
{
if(!strcmp(nip,”13540121″))
{return “I”;}
else if(!strcmp(nip,”13540424″))
{return “I”;}
else if(!strcmp(nip,”13540488″))
{return “II”;}
else if(!strcmp(nip,”13540773″))
{return “II”;}
else if(!strcmp(nip,”13540999″))
{return “III”;}
}

main()
{
class
{
public:
char nip[9];
int jam,honor,total;
}guru[10];

int i,j;
long int tokes=0;
clrscr();
cout<<“==============================================”<<endl;
cout<<”  PROGRAM HITUNG HONORIUM GURU HONORER”<<endl;
cout<<“==============================================”<<endl;
cout<<“Jumlah Data Guru  :”;cin>>j;
for(i=1;i<=j;i++)
{
cout<<endl;
cout<<“Data ke-“<<i<<endl;
cout<<“NIP                 : “;cin>>guru[i].nip;
cout<<“Nama                : “<<nama(guru[i].nip)<<endl;
cout<<“Golongan            : “<<gol(guru[i].nip)<<endl;
if(!strcmp(gol(guru[i].nip),”I”))
{guru[i].honor=15000;}
else if(!strcmp(gol(guru[i].nip),”II”))
{guru[i].honor=26500;}
else if(!strcmp(gol(guru[i].nip),”III”))
{guru[i].honor=88000;}
cout<<“Jumlah Jam Mengajar : “;cin>>guru[i].jam;
guru[i].total=guru[i].honor*guru[i].jam;
tokes=tokes+guru[i].total;
}
clrscr();
cout<<“=========================================================================”<<endl;
cout<<“No. NIP      Nama                Golongan    Honor     Jam        Total”<<endl;
cout<<”             Guru                                      mengajar”<<endl;
cout<<“=========================================================================”<<endl;
for(i=1;i<=j;i++)
{
cout<<setiosflags(ios::left)<<setw(4)<<i;
cout<<setiosflags(ios::left)<<setw(9)<<guru[i].nip;
cout<<setiosflags(ios::left)<<setw(20)<<nama(guru[i].nip);
cout<<setiosflags(ios::left)<<setw(12)<<gol(guru[i].nip);
cout<<setiosflags(ios::left)<<setw(10)<<guru[i].honor;
cout<<setiosflags(ios::left)<<setw(12)<<guru[i].jam;
cout<<setiosflags(ios::left)<<setw(5)<<guru[i].total<<endl;
}
cout<<“=======================================================================”<<endl;
cout<<”                               Total Keseluruhan : Rp. “<<tokes<<endl;
//cout<<”                          Total Honor Tertinggi: RP. “<< <<endl;
//cout<<”                          Total Honor Terendah : Rp. “<< <<endl;
getch();
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: