Breaking News
Loading...
Wednesday, 4 February 2015

Pemrograman DOS "Mencari Nilai Terbesar"

09:06
berikut adalah script untuk menampilkan nilai terendah dengan pemrograman sederhana DOS :

program mencari_nilai_terbesar;
uses wincrt;

type
    tnilai=integer;
    lnilai=array [1..100] of tnilai;
var
   nilai:lnilai;
   k,n:integer;
   tertinggi:integer;

begin
write('selamat datang di program baru!!!!!');
write('Masukkan Jumlah Data: ');readln(n);
for k:=1 to n do
begin
write('Input Data Ke ',k,': ');readln(nilai[k]);
tertinggi:=1;
end;
for k:=2 to n do
if nilai[k] > nilai[tertinggi] then
begin
tertinggi:=k;
end;
writeln('Nilai Tertinggi Adalah: ',nilai[tertinggi]);
writeln('=============[]==============');
writeln('nama:muhammad addib zakki mubarrak');
writeln('nim:2011-51-272');
writeln('=============[]==============');
readln;

end.



program nilai_ujian;
uses crt;
label
     kelasg;

var
   nama : array[1..10] of string;
   tugas, absen, uts, uas : array[1..10] of integer;
   rata_rata : array[1..10] of real;
   A, N : integer;
   lagi : char;
   ulang : char;

begin
     kelasg:
             clrscr;
             writeln('selamat datang di program kelas G terbaru!!!!!');
             writeln('.......................DATA NILAI MAHASISWA.........................');
             writeln('====================================================================');
             write('Masukan Jumlah Mahasiswa : ');readln(N);
             writeln;
                     for A := 1 to N do
                     begin
                          writeln('Mahasiswa Ke - ',A);
                          write('Nama Mahasiswa    : '); readln(nama[A]);
                          write('Nilai Tugas       : '); readln(tugas[A]);
                          write('Nilai Absen       : '); readln(absen[A]);
                          write('Nilai UTS         : '); readln(uts[A]);
                          write('Nilai UAS         : '); readln(uas[A]);
                     end;
             writeln;
             clrscr;
             writeln('.......................DATA NILAI MAHASISWA........................');
             writeln('===================================================================');
             writeln('|No |  Nama Mahasiswa   | Tugas | Absen | UTS | UAS | Rata - Rata |');
             writeln('|   |                   |       |       |     |     |             |');
             writeln('===================================================================');
                     for A := 1 to N do
                     begin
                          rata_rata[A] := (0.1 * tugas[A])+(0.2 * absen[A])+(0.3 * uts[A])+(0.4 * uas[A]);
                                          gotoxy(1,A+6); write('|');
                                          gotoxy(2,A+6); write(A); {no}
                                          gotoxy(5,A+6); write('|');
                                          gotoxy(7,A+6); write(nama[A]); {nama mahasiswa}
                                          gotoxy(25,A+6); write('|');
                                          gotoxy(28,A+6); write(tugas[A]); {nilai tugas}
                                          gotoxy(33,A+6); write('|');
                                          gotoxy(36,A+6); write(absen[A]); {nilai absen}
                                          gotoxy(41,A+6); write('|');
                                          gotoxy(43,A+6); write(uts[A]);  {nilai uts}
                                          gotoxy(47,A+6); write('|');
                                          gotoxy(50,A+6); write(uas[A]);  {nilai uas}
                                          gotoxy(53,A+6); write('|');
                                          gotoxy(58,A+6); write(rata_rata[A]:0:0); {rata2}
                                          gotoxy(67,A+6); write('|');
                     end;
             writeln;
             writeln('====================================================================');
             writeln;
             write('Ingin Mengulang Kembali [Y/T] : ');
             readln (lagi);
                  if lagi = 'Y' then
                                goto kelasg ;
readln;
end.



itulah scrip untuk menampilkan nilai terendah dari pemrograman sederhana. semoga bermanfaat.

0 comments:

Post a Comment

 
Toggle Footer