1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
#include <conio.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAKS 50
#define LERES 1
#define LEPAT 0
typedef int boolean;
struct tenaga_honorer{
char nama[31];
char tempat_lahir[11];
char jenis_kelamin[2];
double nilai;
};
void Cetak(tenaga_honorer Daftar[], int maks);
void CetakKarBaris(char c, int jum);
void Uruttenaga_honorer(tenaga_honorer Daftar[], int maks, int kodeUrut);
int CariNamaSeq(tenaga_honorer Daftar[], int maks, char cNama[]);
int CariNamaBin(tenaga_honorer Daftar[], int maks, char cNama[]);
int Caritempat_lahirSeq(tenaga_honorer Daftar[], int maks, char ctempat_lahir[]);
int Caritempat_lahirBin(tenaga_honorer Daftar[], int maks, char ctempat_lahir[]);
int Carijenis_kelaminSeq(tenaga_honorer Daftar[], int maks, char ctempat_lahir[]);
int Carijenis_kelaminBin(tenaga_honorer Daftar[], int maks, char ctempat_lahir[]);
int HitungLulus(tenaga_honorer Daftar[], int maks, double nilaiMin);
int main () {
int k,nMin;
char cNama[31];
char ctempat_lahir[11];
char cjenis_kelamin[2];
tenaga_honorer pns[50]=
{{"TUTI ALAWIYAH","BEKASI","P",70.53},
{"SUYATMI","BOYOLALI","P",82.52},
{"UJA SUKMANA","JAKARTA","L",82.82},
{"THAPA SAYOGA","BEKASI","L",83.92},
{"TAUFIK","PEMALANG","L",84.92},
{"MUHAMAD NURDIANSYAH","BEKASI","L",81.92},
{"TATI NURHAYATI","GUNUNG KIDUL","P",85.92},
{"TATI HARTATI","WONOSARI","P",86.92},
{"SURATMI","JAKARTA","P",87.92},
{"SURYANI","BANTUL","P",88.92},
{"TATI","JAKARTA","P",89.92},
{"MUHAJIRIN","BANDUNG","L",80.92},
{"MONO","PAPUA","L",82.12},
{"PUTRA","MEDAN","L",82.22},
{"RANI","PONTIANAK","P",82.32},
{"RINA","YOGYAKARTA","P",82.42},
{"SATRIO","JAKARTA","L",82.52},
{"BUDI","SRAGEN","L",82.72},
{"MANDA","KLATEN","P",82.82},
{"NUFI","BANTEN","P",82.91},
{"LISDA","TANGERANG","P",82.93},
{"NHILDA","JAKARTA","P",82.94},
{"AZIZ","PURWOKERTO","L",82.95},
{"AHMAD","JAKARTA","L",82.96},
{"RAHMAT","BANDUNG","L",82.97},
{"MARYATI","BEKASI","P",82.98},
{"MARYANI","BEKASI","P",82.99},
{"MAYSAROH","JAKARTA","P",52.92},
{"ABDUL","PONTIANAK","L",42.92},
{"GOFUR","JAKARTA","L",62.92},
{"SITI","BEKASI","P",63.92},
{"JATI","PONTIANAK","P",64.92},
{"KUSUMA","WONOSARI","L",65.92},
{"AKBAR","JAKARTA","L",66.92},
{"JAYA","PAPUA","L",67.92},
{"JOKO","BEKASI","L",66.92},
{"PUSPITA","PONTIANAK","P",69.92},
{"YADI","JAKARTA","L",60.92},
{"YOGI","PAPUA","L",51.92},
{"DANI","WONOSARI","L",53.92},
{"RAFI","PONTIANAK","L",54.92},
{"PARIS","JAKARTA","L",56.92},
{"HALIMAH","PAPUA","P",55.92},
{"SALI","WONOSARI","L",58.92},
{"GOZALI","WONOSARI","L",59.92},
{"PUSPANDARU","BEKASI","L",39.92},
{"WISNU","JAKARTA","L",41.92}};
Cetak(tenaga_honorer,50);
printf("\n");
printf("Nama yang dicari : ");
gets(cNama);
CariNamaBin(tenaga_honorer, 50, cNama);
printf("\n\n");
CetakKarBaris('~',75);
printf("PENGURUTAN DATA\n");
CetakKarBaris('~',75);
printf("1 -> urut berdasar namaMahasiswa\n2 -> urut berdasar noReg\n3 -> urut berdasar nilai\nMasukkan kode pengurutan: ");
k = getche();
printf("\n");
UrutMahasiswa(tenaga_honorer,50,k);
printf("\n");
Cetak(tenaga_honorer,50);
printf("\n");
printf("tempat_lahir yang dicari : ");
gets(ctempat_lahir);
Caritempat_lahirBin(tenaga_honorer, 50, ctempat_lahir);
printf("\n");
printf("\n");
printf("Nama yang dicari : ");
gets(cNama);
CariNamaSeq(tenaga_honorer, 27, cNama);
printf("\n");
printf("\n");
printf("tempat_lahir yang dicari : ");
gets(ctempat_lahir);
Caritempat_lahirSeq(tenaga_honorer, 50, ctempat_lahir);
printf("\n");
printf("\n");
printf("Tentukan Nilai minimum : ");
scanf("%d",&nMin);
printf("Jumlah tenaga honorer yang melewati nilai minimum : %d ",HitungLulus(tenaga_honorer, 50, nMin));
printf("\n\n");
system("pause");
return 0;
}
|