ini hasilnya. |
program TugasStrukturData1;
//Nama : Dian Wicaksono
{$APPTYPE CONSOLE}
uses
SysUtils;
var
t1,t2,t3,t4,t5,uts,uas,jumlahtugas,nilai_rata2,nilai_total,bobot_tugas,bobot_uts,bobot_uas : real;
nilai_huruf : string;
begin
//Input
writeln(' --------Tugas Struktur Data Menghitung Nilai Mahasiswa------------- ');
writeln('===============================================================================');
writeln('');
write('Nilai Tgs 1 = ');readln(t1);
write('Nilai Tgs 2 = ');readln(t2);
write('Nilai Tgs 3 = ');readln(t3);
write('Nilai Tgs 4 = ');readln(t4);
write('Nilai Tgs 5 = ');readln(t5);
write('Nilai UTS = ');readln(uts);
write('Nilai UAS = ');readln(uas);
writeln('');
//Proses
jumlahtugas := t1+t2+t3+t4+t5;
nilai_rata2 := jumlahtugas/5;
bobot_tugas := nilai_rata2 * 0.2;
bobot_uts := uts * 0.4;
bobot_uas := uas * 0.4;
nilai_total := bobot_tugas + bobot_uts + bobot_uas;
if nilai_total <50 then
nilai_huruf := 'E';
if nilai_total <60 then
nilai_huruf := 'D';
if nilai_total <70 then
nilai_huruf := 'C';
if nilai_total <85 then
nilai_huruf := 'B';
if nilai_total >85 then
nilai_huruf := 'A';
//Output
writeln('Jumlah Nilai Tugas = ',jumlahtugas:2:2);
writeln('Nilai Rata Rata = ',nilai_rata2:2:2);
writeln('Bobot Tugas = ',bobot_tugas:2:2);
writeln('Bobot UTS = ',bobot_uts:2:2);
writeln('Bobot UAS = ',bobot_uas:2:2);
writeln('Nilai Total = ',nilai_total:2:2);
readln;
end.
0 Response to "Menghitung Nilai Mahasiswa Dengan Delphi7"
Post a Comment