1. Contoh Program
2. Uses Crt;
3. Const
4. JumlahSiswa = 1;
5. Type Nilai = Record
6. Nim : String;
7. Nama: String;
8. Tugas : Real;
9. UTS : Real;
10. UAS : Real;
11. End;
12. Var
13. Mhs : Array[1..JumlahSiswa] of Nilai;
14. I : Integer;
15. Begin
16. Clrscr;
17. For I := 1 To JumlahSiswa Do
18. Begin
19. Writeln('Mahasiswa ke : ',i:2);
20. Write('Nim : ');Readln(Mhs[i].Nim);
21. Write('Nama : ');Readln(Mhs[i].Nama);
22. Write('Tugas : ');Readln(Mhs[i].Tugas);
23. Write('UTS : ');Readln(Mhs[i].Uts);
24. Write('UAS : ');Readln(Mhs[i].Uas);
25. End;
26. Writeln('----------------------------------------------------------');
27. Writeln(' NO NIM NAMA TUGAS UTS UAS NA GRADE ');
28. Writeln('----------------------------------------------------------');
29. For I := 1 To JumlahSiswa Do
30. Begin
31. Writeln(i:3,Mhs[i].Nim:10,Mhs[i].Nama:10,Mhs[i].Tugas:7:2,Mhs[i].Uts:7:2,
32. Mhs[i].Uas:7:2);
33. End;
34. Readln;
35. End.
36.
37.
Output program yang dihasilkan
Tidak ada komentar:
Posting Komentar