-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTABLEtotal.pas
More file actions
47 lines (37 loc) · 923 Bytes
/
TABLEtotal.pas
File metadata and controls
47 lines (37 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Uses Crt;
Const JumlahBarang = 3;
Type Nilai = Record
Nama: String;
jumlah : Integer;
End;
Var
Mhs : Array[1..JumlahBarang] of Nilai;
I : Integer;
total : Integer;
Begin
Clrscr;
For I := 1 To JumlahBarang Do
Begin
With Mhs[i] Do
Begin
Writeln('Barang ke : ',i:2);
Write('Nama Barang : ');Readln(Nama);
Write('Jumlah : ');Readln(Jumlah);
total := Jumlah+total;
End;
End;
Clrscr;
Writeln(' DAFTAR BARANG ');
Writeln('---------------------------------');
Writeln(' NO Nama Barang Jumlah');
Writeln('---------------------------------');
For I := 1 To JumlahBarang Do
Begin
With Mhs[i] Do
Begin
Writeln(i:3,Nama:11,jumlah:11);
End;
End;
Writeln(' TOTAL: ',total);
Readln;
End.