#include<iostream.h>
#include<conio.h>
#include<stdio.h>
struct jabatan
{
char kode_jabatan;
char nama_jabatan;
int tunjangan;
};
struct pegawai
{
char nip[10];
char nama[30];
char gol[15];
struct jabatan jb;
};
struct pegawai peg;
main()
{
int gaji;
cout<<"\n INPUT DATA\n\n";
cout<<"nip =";gets(peg.nip);
cout<<"Nama=";gets(peg.nama);
cout<<"golongan=";gets(peg.gol);
cout<<"kode jabatan=";cin>>peg.jb.kode_jabatan;
cout<<"nama jabatan=";cin>>peg.jb.nama_jabatan;
cout<<"tunjangan=";cin>>peg.jb.tunjangan;
cout<<"\n-----------------------\n\n";
cout<<"\n OUTPUT\n\n";
cout<<"NIP="<<peg.nip<<endl;
cout<<"nama="<<peg.nama<<endl;
cout<<"golongan="<<peg.gol<<endl;
cout<<"kode jabatan="<<peg.jb.kode_jabatan<<endl;
cout<<"nama jabatan="<<peg.jb.nama_jabatan<<endl;
cout<<"tunjangan="<<peg.jb.tunjangan<<endl;
if(strcmp(peg.gol,"1a")==0)
gaji=1000000;
else if(strcmp(peg.gol,"1b")==0)
gaji=2000000;
else if(strcmp(peg.gol,"1c")==0)
gaji=3000000;
cout<<"gaji pokok="<<gaji<<endl;
getch();
}
Subscribe to:
Post Comments (Atom)
CONTOH CODING LINKED LIST MENGGUNAKAN BORLAND C++
CONTOH CODING LINKED LIST MENGGUNAKAN BORLAND C++ #include<stdlib.h> #include<conio.h> #include<iostream.h> struc...
-
#include <iostream.h> #include <conio.h> #include <fstream.h> #include <stdio.h> #include <stdlib.h> struct pa...
-
#include <iostream.h> #include <conio.h> #include <fstream.h> #include <stdio.h> #include <iomanip.h> #include...
-
#include <iostream.h> #include <iomanip.h> #include <stdio.h> #include <conio.h> void coba(); struct rumahsakit { ...
No comments:
Post a Comment