Sunday, 21 October 2012

Program Menghitung indeks prestasi (PASCAL)


Program Menghitung_IP;
{I.S: User memasukkan data diri mahasiswa}
{F.S: Menampilkan data inputan user dan Menampilkan IP mahasiswa}

var

NIM,Nama,Kelas,Semester,Jurusan,Fakultas,Universitas : string;
Kode_Mata_Kuliah1,Kode_Mata_Kuliah2,Kode_Mata_Kuliah3,Kode_Mata_Kuliah4,Kode_Mata_Kuliah5: string;
Nama_Mata_Kuliah1,Nama_Mata_Kuliah2,Nama_Mata_Kuliah3,Nama_Mata_Kuliah4,Nama_Mata_Kuliah5 : string;
Index1,Index2,Index3,Index4,Index5 : char;
BobotNilai1,BobotNilai2,BobotNilai3,BobotNilai4,BobotNilai5 : real;
nilai1,nilai2,nilai3,nilai4,nilai5 : real;
IP : real;
total_nilai, total_bobot: real;

begin
Writeln('"Program Menghitung IP Mahasiswa"');
writeln('---------------------------------');
write ('Masukan NIM : '); readln(NIM);
write ('Masukan Nama: '); readln(nama);
write ('Masukan Kelas: '); readln(Kelas);
write ('Masukan Semester : '); readln (Semester);
write ('Masukan Jurusan : '); readln (Jurusan);
write ('Masukan Fakultas : '); readln (Fakultas);
write ('Masukan Universitas : '); readln(Universitas);
writeln;
writeln ('===========================================');
write ('Masukan Kode Mata Kuliah 1 : '); readln(kode_mata_kuliah1);
write ('Masukan Nama Mata Kuliah 1: '); readln(Nama_Mata_Kuliah1);
write ('Masukan Index : '); readln(index1);
write ('Masukan Bobot Nilai :'); readln(bobotnilai1);
write ('Masukan Nilai : '); readln (nilai1);
writeln;
writeln ('===========================================');
write ('Masukan Kode Mata Kuliah 2 : '); readln(kode_mata_kuliah2);
write ('Masukan Nama Mata Kuliah 2: '); readln(Nama_Mata_Kuliah2);
write ('Masukan Index : '); readln(index2);
write ('Masukan Bobot Nilai :'); readln(bobotnilai2);
write ('Masukan nilai : '); readln (nilai2);
writeln;
writeln ('===========================================');
write ('Masukan Kode Mata Kuliah 3 : '); readln(kode_mata_kuliah3);
write ('Masukan Nama Mata Kuliah 3: '); readln(Nama_Mata_Kuliah3);
write ('Masukan Index : '); readln(index3);
write ('Masukan Bobot Nilai :'); readln(bobotnilai3);
write ('Masukan nilai : '); readln (nilai3);
writeln;
writeln ('===========================================');
write ('Masukan Kode Mata Kuliah 4 : '); readln(kode_mata_kuliah4);
write ('Masukan Nama Mata Kuliah 4: '); readln(Nama_Mata_Kuliah4);
write ('Masukan Index : '); readln(index4);
write ('Masukan Bobot Nilai :'); readln(bobotnilai4);
write ('Masukan nilai : '); readln (nilai4);
writeln;
writeln ('===========================================');
write ('Masukan Kode Mata Kuliah 5 : '); readln(kode_mata_kuliah5);
write ('Masukan Nama Mata Kuliah 5: '); readln(Nama_Mata_Kuliah5);
write ('Masukan Index : '); readln(index5);
write ('Masukan Bobot Nilai :'); readln(bobotnilai5);
write ('Masukan nilai : '); readln (nilai5);
writeln ('===========================================');
writeln;

{PERHITUNGAN NILAI }

total_nilai := (nilai1*bobotnilai1) +(nilai2*bobotnilai2) +(nilai3*bobotnilai3) +(nilai4*bobotnilai4) +(nilai5*bobotnilai5) ;
total_bobot := bobotnilai1 + bobotnilai2 + bobotnilai3 + bobotnilai4 + bobotnilai5;
IP:= total_nilai/total_bobot;
writeln ('OUTPUT');
writeln ('===========================================');
writeln ('DATA MAHASISWA');
writeln ('NIM : ', NIM);
writeln ('Nama : ', nama);
writeln ('Kelas : ', kelas);
writeln ('Semester : ', semester);
writeln ('Jurusan : ', jurusan);
writeln ('Fakultas : ', fakultas);
writeln ('Universitas : ', universitas);
writeln;
writeln ('===========================================');
writeln ('Kode Mata Kuliah 1 : ',kode_mata_kuliah1);
writeln ('Nama Mata Kuliah 1 : ',Nama_Mata_Kuliah1);
writeln ('Index : ',index1);
writeln ('Bobot Nilai :',bobotnilai1:0:2);
writeln ('Nilai : ',nilai1:0:2);
writeln;
writeln ('===========================================');
writeln ('Kode Mata Kuliah 2 : ',kode_mata_kuliah2);
writeln ('Nama Mata Kuliah 2 : ',Nama_Mata_Kuliah2);
writeln ('Index : ',index2);
writeln ('Bobot Nilai :',bobotnilai2:0:2);
writeln ('Nilai : ',nilai2:0:2);
writeln;
writeln ('===========================================');
writeln ('Kode Mata Kuliah 3 : ',kode_mata_kuliah3);
writeln ('Nama Mata Kuliah 3 : ',Nama_Mata_Kuliah3);
writeln ('Index : ',index3);
writeln ('Bobot Nilai :',bobotnilai3:0:2);
writeln ('Nilai : ',nilai3:0:2);
writeln;
writeln ('===========================================');
writeln ('Kode mata Kuliah 4 : ',kode_mata_kuliah4);
writeln ('Nama Mata Kuliah 4 : ',Nama_Mata_Kuliah4);
writeln ('Index : ',index4);
writeln ('Bobot Nilai :',bobotnilai4:0:2);
writeln ('Nilai : ',nilai4:0:2);
writeln;
writeln ('===========================================');
writeln ('Kode Mata Kuliah 5 : ',kode_mata_kuliah5);
writeln ('Nama Mata Kuliah 5 : ',Nama_Mata_Kuliah5);
writeln ('Index : ',index5 );
writeln ('Bobot Nilai :',bobotnilai5 :0:2);
writeln ('Nilai : ',nilai5 :0:2);
writeln;
writeln ('===========================================');
writeln ('IP Anda Adalah : ',IP:0:2);


readln;

end.

No comments:

Post a Comment