M. Mahmud Ragil s 08650075 Tif B •
SOURCE PROGRAM
#include #include #include #include
<stdio.h> <string.h>
void main() { printf ("---===ooo000 BISMILLAAHIRRAHMAANIRRAHIIM 000ooo===---\n\n"); printf ("====================================================="); printf ("\n"); printf (" Program Mencetak KHS Mahasiswa "); printf ("\n"); printf (" dibuat oleh : M. Mahmud Ragil S. "); printf ("\n"); printf (" 08650075 "); printf ("\n"); printf ("====================================================="); printf ("\n"); printf ("Hanya diambil sampel rata-rata 5 kali \n\n\n\n"); int totsks; float totharkat; float ipk; int pil; int kf; int loop=1; while (loop==1) { struct mahasiswa /* Deklarasi Data Mahasiswa */ { int nim; char nama[30]; }; struct matakuliah /* Deklarasi Data Matakuliah */ { char kode[12]; char namamk[30]; int sks; }; struct programstudi /* Deklarasi Data Program Studi */ { char kode[3]; char namaprodi[20]; }; struct nilaimk /* Deklarasi Data Nilai */ { char nilai[5]; float bobot; float harkat; }; struct progstud { struct programstudi struct programstudi struct programstudi struct programstudi struct programstudi struct programstudi struct programstudi struct programstudi struct programstudi struct programstudi }ps;
kode1; namaprodi1; kode2; namaprodi2; kode3; namaprodi3; kode4; namaprodi4; kode5; namaprodi5;
/* merekam data program studi */ strcpy (ps.kode1.kode, "65");
strcpy strcpy strcpy strcpy strcpy strcpy strcpy strcpy strcpy
(ps.namaprodi1.namaprodi, (ps.kode2.kode, "66"); (ps.namaprodi2.namaprodi, (ps.kode3.kode, "67"); (ps.namaprodi3.namaprodi, (ps.kode4.kode, "68"); (ps.namaprodi4.namaprodi, (ps.kode5.kode, "69"); (ps.namaprodi5.namaprodi,
struct maku { struct struct struct struct struct struct struct struct struct struct struct struct struct struct struct } kuli;
matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah matakuliah
"Teknik Informatika"); "Teknik Industri"); "Teknik Mesin"); "Teknik Sipil"); "Teknik Elektro");
kode1; namamk1; sks1; kode2; namamk2; sks2; kode3; namamk3; sks3; kode4; namamk4; sks4; kode5; namamk5; sks5;
/* merekam data mata kuliah */ strcpy (kuli.kode1.kode,"MAT-203-1-3 "); strcpy (kuli.namamk1.namamk, "Kalkulus I "); (kuli.sks1.sks = 3); strcpy (kuli.kode2.kode,"MAT-301-1-3 "); strcpy (kuli.namamk2.namamk, "Metode Statistik "); (kuli.sks2.sks = 3); strcpy (kuli.kode3.kode,"FIS-201-3-2 "); strcpy (kuli.namamk3.namamk, "Fisika Dasar "); (kuli.sks3.sks = 2); strcpy (kuli.kode4.kode,"TIF-219-2-2 "); strcpy (kuli.namamk4.namamk, "Pengantar Teknologi Informasi (kuli.sks4.sks = 2); strcpy (kuli.kode5.kode,"USK-109-1-2 "); strcpy (kuli.namamk5.namamk, "Islam dan Budaya Lokal "); (kuli.sks5.sks = 2); struct nimk { struct struct struct struct struct struct struct struct struct struct struct struct struct struct struct } nm;
nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk nilaimk
nilai1; bobot1; harkat1; nilai2; bobot2; harkat2; nilai3; bobot3; harkat3; nilai4; bobot4; harkat4; nilai5; bobot5; harkat5;
struct mahasiswa mhs ; /* Input Data Mahasiswa */ { { printf printf printf printf printf
("NIM = "); scanf ("%d",&mhs.nim); ("Nama Mahasiswa = "); scanf ("%s",mhs.nama); ("\n"); ("--------------------------------------------------------\n"); (" Kode MK Nama Matakuliah Nilai \n");
");
printf printf printf printf
("--------------------------------------------------------\n"); ("%s",kuli.kode1.kode); ("%s",kuli.namamk1.namamk); (" "); scanf ("%s",nm.nilai1.nilai);
printf ("%s",kuli.kode2.kode); printf ("%s",kuli.namamk2.namamk); printf (" "); scanf ("%s",nm.nilai2.nilai); printf ("%s",kuli.kode3.kode); printf ("%s",kuli.namamk3.namamk); printf (" "); scanf ("%s",nm.nilai3.nilai); printf ("%s",kuli.kode4.kode); printf ("%s",kuli.namamk4.namamk); printf (" "); scanf ("%s",nm.nilai4.nilai); printf printf printf printf printf
("%s",kuli.kode5.kode); ("%s",kuli.namamk5.namamk); (" "); scanf ("%s",nm.nilai5.nilai); ("--------------------------------------------------------"); ("\n\n\n\n");
} /* konversi Nilai ke Bobot */ if (strcmp(nm.nilai1.nilai,"A")==0){nm.bobot1.bobot = 4.00;} else if (strcmp(nm.nilai1.nilai,"A-")==0){nm.bobot1.bobot = 3.75;} else if (strcmp(nm.nilai1.nilai,"A/B")==0){nm.bobot1.bobot = 3.50;}
else if (strcmp(nm.nilai1.nilai,"B+")==0){nm.bobot1.bobot
= 3.25;}
else if (strcmp(nm.nilai1.nilai,"B")==0){nm.bobot1.bobot = 3.00;}
else if
(strcmp(nm.nilai1.nilai,"B-")==0){nm.bobot1.bobot = 2.75;}
else if
(strcmp(nm.nilai1.nilai,"B/C")==0){nm.bobot1.bobot = 2.50;}
else if
(strcmp(nm.nilai1.nilai,"C+")==0){nm.bobot1.bobot = 2.25;}
else if
(strcmp(nm.nilai1.nilai,"C")==0){nm.bobot1.bobot = 2.00;}
else if
(strcmp(nm.nilai1.nilai,"C-")==0){nm.bobot1.bobot = 1.75;}
else if
(strcmp(nm.nilai1.nilai,"C/D")==0){nm.bobot1.bobot = 1.50;} else if (strcmp(nm.nilai1.nilai,"D+")==0){nm.bobot1.bobot = 1.25;} else if (strcmp(nm.nilai1.nilai,"D")==0){nm.bobot1.bobot = 1.00;} else if (strcmp(nm.nilai1.nilai,"E")==0){nm.bobot1.bobot = 0;} else {nm.bobot1.bobot = 00;}
3.50;} = 3.25;}
if (strcmp(nm.nilai2.nilai,"A")==0){nm.bobot2.bobot = 4.00;} else if (strcmp(nm.nilai2.nilai,"A-")==0){nm.bobot2.bobot = 3.75;} else if (strcmp(nm.nilai2.nilai,"A/B")==0){nm.bobot2.bobot = else if (strcmp(nm.nilai2.nilai,"B+")==0){nm.bobot2.bobot
else if (strcmp(nm.nilai2.nilai,"B")==0){nm.bobot2.bobot = 3.00;} (strcmp(nm.nilai2.nilai,"B-")==0){nm.bobot2.bobot = 2.75;} (strcmp(nm.nilai2.nilai,"B/C")==0){nm.bobot2.bobot = 2.50;} (strcmp(nm.nilai2.nilai,"C+")==0){nm.bobot2.bobot = 2.25;} (strcmp(nm.nilai2.nilai,"C")==0){nm.bobot2.bobot = 2.00;} (strcmp(nm.nilai2.nilai,"C-")==0){nm.bobot2.bobot = 1.75;} (strcmp(nm.nilai2.nilai,"C/D")==0){nm.bobot2.bobot = 1.50;}
else if else if else if else if else if else if
else if (strcmp(nm.nilai2.nilai,"D+")==0){nm.bobot2.bobot = 1.25;} else if (strcmp(nm.nilai2.nilai,"D")==0){nm.bobot2.bobot = 1.00;} else if (strcmp(nm.nilai2.nilai,"E")==0){nm.bobot2.bobot = 0;} if (strcmp(nm.nilai3.nilai,"A")==0){nm.bobot3.bobot = 4.00;} else if (strcmp(nm.nilai3.nilai,"A-")==0){nm.bobot3.bobot = 3.75;} else if (strcmp(nm.nilai3.nilai,"A/B")==0){nm.bobot3.bobot = 3.50;}
else if (strcmp(nm.nilai3.nilai,"B+")==0){nm.bobot3.bobot
= 3.25;}
else if (strcmp(nm.nilai3.nilai,"B")==0){nm.bobot3.bobot = 3.00;}
else if
(strcmp(nm.nilai3.nilai,"B-")==0){nm.bobot3.bobot = 2.75;}
else if
(strcmp(nm.nilai3.nilai,"B/C")==0){nm.bobot3.bobot = 2.50;}
else if
(strcmp(nm.nilai3.nilai,"C+")==0){nm.bobot3.bobot = 2.25;}
else if
(strcmp(nm.nilai3.nilai,"C")==0){nm.bobot3.bobot = 2.00;}
else if
(strcmp(nm.nilai3.nilai,"C-")==0){nm.bobot3.bobot = 1.75;}
else if
(strcmp(nm.nilai3.nilai,"C/D")==0){nm.bobot3.bobot = 1.50;} else if (strcmp(nm.nilai3.nilai,"D+")==0){nm.bobot3.bobot = 1.25;} else if (strcmp(nm.nilai3.nilai,"D")==0){nm.bobot3.bobot = 1.00;} else if (strcmp(nm.nilai3.nilai,"E")==0){nm.bobot3.bobot = 0;} if (strcmp(nm.nilai4.nilai,"A")==0){nm.bobot4.bobot = 4.00;} else if (strcmp(nm.nilai4.nilai,"A-")==0){nm.bobot4.bobot = 3.75;} else if (strcmp(nm.nilai4.nilai,"A/B")==0){nm.bobot4.bobot =
3.50;} = 3.25;}
else if (strcmp(nm.nilai4.nilai,"B+")==0){nm.bobot4.bobot
else if (strcmp(nm.nilai4.nilai,"B")==0){nm.bobot4.bobot = 3.00;} (strcmp(nm.nilai4.nilai,"B-")==0){nm.bobot4.bobot = 2.75;}
else if else if
(strcmp(nm.nilai4.nilai,"B/C")==0){nm.bobot4.bobot = 2.50;}
else if
(strcmp(nm.nilai4.nilai,"C+")==0){nm.bobot4.bobot = 2.25;}
else if
(strcmp(nm.nilai4.nilai,"C")==0){nm.bobot4.bobot = 2.00;}
else if
(strcmp(nm.nilai4.nilai,"C-")==0){nm.bobot4.bobot = 1.75;}
else if
(strcmp(nm.nilai4.nilai,"C/D")==0){nm.bobot4.bobot = 1.50;} else if (strcmp(nm.nilai4.nilai,"D+")==0){nm.bobot4.bobot = 1.25;} else if (strcmp(nm.nilai4.nilai,"D")==0){nm.bobot4.bobot = 1.00;} else if (strcmp(nm.nilai4.nilai,"E")==0){nm.bobot4.bobot = 0;}
if (strcmp(nm.nilai5.nilai,"A")==0){nm.bobot5.bobot = 4.00;} else if (strcmp(nm.nilai5.nilai,"A-")==0){nm.bobot5.bobot = 3.75;} else if (strcmp(nm.nilai5.nilai,"A/B")==0){nm.bobot5.bobot = 3.50;}
else if (strcmp(nm.nilai5.nilai,"B+")==0){nm.bobot5.bobot
= 3.25;}
else if (strcmp(nm.nilai5.nilai,"B")==0){nm.bobot5.bobot = 3.00;} (strcmp(nm.nilai5.nilai,"B-")==0){nm.bobot5.bobot = 2.75;} (strcmp(nm.nilai5.nilai,"B/C")==0){nm.bobot5.bobot = 2.50;} (strcmp(nm.nilai5.nilai,"C+")==0){nm.bobot5.bobot = 2.25;}
else if else if else if
(strcmp(nm.nilai5.nilai,"C")==0){nm.bobot5.bobot = 2.00;} (strcmp(nm.nilai5.nilai,"C-")==0){nm.bobot5.bobot = 1.75;}
else if else if
(strcmp(nm.nilai5.nilai,"C/D")==0){nm.bobot5.bobot = 1.50;}
else if
else if (strcmp(nm.nilai5.nilai,"D+")==0){nm.bobot5.bobot = 1.25;} else if (strcmp(nm.nilai5.nilai,"D")==0){nm.bobot5.bobot = 1.00;} else if (strcmp(nm.nilai5.nilai,"E")==0){nm.bobot5.bobot = 0;} nm.harkat1.harkat nm.harkat2.harkat nm.harkat3.harkat nm.harkat4.harkat nm.harkat5.harkat
= = = = =
kuli.sks1.sks kuli.sks2.sks kuli.sks3.sks kuli.sks4.sks kuli.sks5.sks
* * * * *
nm.bobot1.bobot; nm.bobot2.bobot; nm.bobot3.bobot; nm.bobot4.bobot; nm.bobot5.bobot;
totsks = kuli.sks1.sks + kuli.sks2.sks + kuli.sks3.sks + kuli.sks4.sks + kuli.sks5.sks; totharkat = nm.harkat1.harkat + nm.harkat2.harkat + nm.harkat3.harkat + nm.harkat4.harkat + nm.harkat5.harkat; ipk = totharkat/totsks; } /* Mencetak program */ printf ("---===ooo000 HASIL CETAK PROGRAM 000ooo===---"); printf ("\n\n\n"); printf ("UNIVERSITAS ISLAM NEGERI SUNAN KALIJAGA YOGYAKARTA \n"); printf ("FAKULTAS SAINS DAN TEKNOLOGI \n"); printf ("KARTU HASIL STUDY \n\n"); printf ("NIM = 0%d\n",mhs.nim); printf ("Nama Mahasiswa = %s\n",mhs.nama); kf=mhs.nim/10000%100; switch (kf) /* Menampilkan program studi berdasarkan NIM */ { case 65: printf ("Program Studi = %s", ps.namaprodi1.namaprodi); break; case 66: printf ("Program Studi = %s", ps.namaprodi2.namaprodi); break; case 67: printf ("Program Studi = %s", ps.namaprodi3.namaprodi); break; case 68: printf ("Program Studi = %s", ps.namaprodi4.namaprodi); break; case 69: printf ("Program Studi = %s", ps.namaprodi5.namaprodi); break; } printf ("\n\n"); printf ("------------------------------------------------------------------------------\n"); printf (" Kode MK Nama Matakuliah SKS Nilai Bobot Harkat \n");
printf printf printf printf printf printf printf
("------------------------------------------------------------------------------\n"); ("%s",kuli.kode1.kode); ("%s",kuli.namamk1.namamk); (" %d",kuli.sks1.sks); (" %s",nm.nilai1.nilai); (" %.2f",nm.bobot1.bobot); (" %.2f\n",nm.harkat1.harkat);
printf printf printf printf printf printf
("%s",kuli.kode2.kode); ("%s",kuli.namamk2.namamk); (" %d",kuli.sks2.sks); (" %s",nm.nilai2.nilai); (" %.2f",nm.bobot2.bobot); (" %.2f\n",nm.harkat2.harkat);
printf ("%s",kuli.kode3.kode);
printf printf printf printf printf
("%s",kuli.namamk3.namamk); (" %d",kuli.sks3.sks); (" %s",nm.nilai3.nilai); (" %.2f",nm.bobot3.bobot); (" %.2f\n",nm.harkat3.harkat);
printf printf printf printf printf printf
("%s",kuli.kode4.kode); ("%s",kuli.namamk4.namamk); ("%d",kuli.sks4.sks); (" %s",nm.nilai4.nilai); (" %.2f",nm.bobot4.bobot); (" %.2f\n",nm.harkat4.harkat);
printf printf printf printf printf printf
("%s",kuli.kode5.kode); ("%s",kuli.namamk5.namamk); (" %d",kuli.sks5.sks); (" %s",nm.nilai5.nilai); (" %.2f",nm.bobot5.bobot); (" %.2f\n",nm.harkat5.harkat);
printf ("------------------------------------------------------------------------------\n"); printf (" %d %.2f", totsks, totharkat); printf ("\n\n"); printf printf printf printf printf printf printf printf
("Keterangan \n"); ("=================================== \n"); ("Indeks Prestasi Kumulatif = %.2f \n",ipk); ("Jumlah SKS = %d \n",totsks); ("=================================== \n"); ("\n\n\n"); ("---===ooo000 ALHAMDULILLAHIRRABILLALAMIIN 000ooo===---"); ("\n\n\n");
do { printf ("Apakah anda ingin memasukan data ulang ? \nTekan 1 untuk YA dan 0 untuk TIDAK = ");
scanf ("%d",&pil); if (pil ==0) exit (0); } while (pil>1); printf ("\n\n"); }
}
•
HASIL KETIKA PROGRAM DI COMPILE
---===ooo000 BISMILLAAHIRRAHMAANIRRAHIIM 000ooo===--===================================================== Program Mencetak KHS Mahasiswa dibuat oleh : M. Mahmud Ragil S. 08650075 ===================================================== Hanya diambil sampel rata-rata 5 kali
NIM = 08650075 Nama Mahasiswa = MAHMUDRAGIL -------------------------------------------------------Kode MK Nama Matakuliah Nilai -------------------------------------------------------MAT-203-1-3 Kalkulus I A MAT-301-1-3 Metode Statistik AFIS-201-3-2 Fisika Dasar B TIF-219-2-2 Pengantar Teknologi Informasi C USK-109-1-2 Islam dan Budaya Lokal B+ --------------------------------------------------------
---===ooo000 HASIL CETAK PROGRAM 000ooo===--UNIVERSITAS ISLAM NEGERI SUNAN KALIJAGA YOGYAKARTA FAKULTAS SAINS DAN TEKNOLOGI KARTU HASIL STUDY NIM = 08650075 Nama Mahasiswa = MAHMUDRAGIL Program Studi = Teknik Informatika -----------------------------------------------------------------------------Kode MK Nama Matakuliah SKS Nilai Bobot Harkat -----------------------------------------------------------------------------MAT-203-1-3 Kalkulus I 3 A 4.00 12.00 MAT-301-1-3 Metode Statistik 3 A3.75 11.25 FIS-201-3-2 Fisika Dasar 2 B 3.00 6.00 TIF-219-2-2 Pengantar Teknologi Informasi 2 C 2.00 4.00 USK-109-1-2 Islam dan Budaya Lokal 2 B+ 3.25 6.50 -----------------------------------------------------------------------------12 39.75 Keterangan =================================== Indeks Prestasi Kumulatif = 3.31 Jumlah SKS = 12 ===================================
---===ooo000 ALHAMDULILLAHIRRABILLALAMIIN 000ooo===--Apakah anda ingin memasukan data ulang ? Tekan 1 untuk YA dan 0 untuk TIDAK = 1 NIM = 08670055 Nama Mahasiswa = BLUES -------------------------------------------------------Kode MK Nama Matakuliah Nilai --------------------------------------------------------
MAT-203-1-3 Kalkulus I A MAT-301-1-3 Metode Statistik B FIS-201-3-2 Fisika Dasar C TIF-219-2-2 Pengantar Teknologi Informasi USK-109-1-2 Islam dan Budaya Lokal --------------------------------------------------------
D E
---===ooo000 HASIL CETAK PROGRAM 000ooo===--UNIVERSITAS ISLAM NEGERI SUNAN KALIJAGA YOGYAKARTA FAKULTAS SAINS DAN TEKNOLOGI KARTU HASIL STUDY NIM = 08670055 Nama Mahasiswa = BLUES Program Studi = Teknik Mesin -----------------------------------------------------------------------------Kode MK Nama Matakuliah SKS Nilai Bobot Harkat -----------------------------------------------------------------------------MAT-203-1-3 Kalkulus I 3 A 4.00 12.00 MAT-301-1-3 Metode Statistik 3 B 3.00 9.00 FIS-201-3-2 Fisika Dasar 2 C 2.00 4.00 TIF-219-2-2 Pengantar Teknologi Informasi 2 D 1.00 2.00 USK-109-1-2 Islam dan Budaya Lokal 2 E 0.00 0.00 -----------------------------------------------------------------------------12 27.00 Keterangan =================================== Indeks Prestasi Kumulatif = 2.25 Jumlah SKS = 12 ===================================
---===ooo000 ALHAMDULILLAHIRRABILLALAMIIN 000ooo===--Apakah anda ingin memasukan data ulang ? Tekan 1 untuk YA dan 0 untuk TIDAK = 0 Press any key to continue . . .