//OFFICIALDANS.K.BLOGSPOT.COM WEDDING AND FOTOGRAFI
#include<iostream>
#include<iomanip>
#include<stdio.h>
using namespace std;
struct Employee_str
{
char ID[20],Name[25],status[15];
int anak,gaji;
char jmlh[2];
};
int main()
{
printf("NAMA : MUHAMAD HUSNI RAMADHAN\n");
printf("NIM : 191011400011 \n");
printf("KELAS: 02TPLE002 \n");
Employee_str employee[6];
int loop;
for(loop=1;loop<6;loop++)
{
cout<<"Data Karyawan 1, 2, 3, .. : ";
cin.getline(employee[loop].jmlh,80.);
cout<<"ID Karyawan : ";
cin.getline(employee[loop].ID,80.);
cout<<"Nama Karyawan : ";
cin.getline(employee[loop].Name,80.);
cout<<"Gaji/Bulan : ";
cin>>employee[loop].gaji;
cin.ignore(80,'\n');
cout<<"Status (Menikah/Belum Menikah) : ";
cin.getline(employee[loop].status,80);
cout<<"Anak (0, / 1, 2, 3, ..) : ";
cin>>employee[loop].anak;
cin.ignore(80,'\n');
cout<<endl;
}
cout<<"Data Karyawan : ";
cout<<endl;
cout.flags(ios::left);
cout<<setw(0)<<"No "<<"ID karyawan"<<" Nama "<<" Gaji "<<" Status "<<" Anak";
cout<<endl;
cout<<"================================================";
cout<<endl;
for(loop=1;loop<6;loop++)
{
cout<<setiosflags(ios::left)<<setw(5)<<loop;
cout<<setiosflags(ios::left)<<setw(10)<<employee[loop].ID;
cout<<setiosflags(ios::left)<<setw(10)<<employee[loop].Name;
cout<<setiosflags(ios::left)<<setw(10)<<employee[loop].gaji;
cout<<setiosflags(ios::left)<<setw(20)<<employee[loop].status;
cout<<setiosflags(ios::left)<<setw(12)<<employee[loop].anak;
cout<<endl;
}
cout<<endl;
return 0;
}
Tidak ada komentar:
Posting Komentar