modul 7

  • Uploaded by: Malik Alfiyan
  • Size: 76.3 KB
  • Type: PDF
  • Words: 459
  • Pages: 9
Report this file Bookmark

* The preview only shows a few pages of manuals at random. You can get the complete content by filling out the form below.

The preview is currently being created... Please pause for a moment!

Description

NAMA : ADAM ALFIYAN MALIK NO

:21.0502.0012 1. LATIHAN 1 Program Tabel1; var i:integer; tab:array [1..10] of integer; n:integer; Begin n:=5; writeln('Isi dan print tabel : '); {*mengisi tabel denganassignment*} for i:=1 to n do begin tab[i]:=i; end; {traversal print isi tabel} for i:=1 to n do begin writeln('i= ',i,'tab[',i,']=',tab[i]); end; End.

Hasil Latihan 1

2. LATIHAN 2 VAR i: integer (* indeks tabel *); tabpoint: array [1..10] of integer; N : integer; Begin N := 5; writeln('Isi dan print tabel '); for i:= 1 to N do begin tabpoint [i].X :=; tabpoint [i].Y := tabpoint [i].X end; writeln('--------'); writeln ('IXY'); writeln('--------'); for i:= 1 to N do begin writeln (i:5, tabpoint [i].X:5, tabpoint[i].Y:5); end; writeln(''); End.

3. LATIHAN 3 Program Larik_Hari; var Hari: array[1..7]of string [10]; K:integer; Begin Hari[1]:='Senin'; Hari[2]:='Selasa'; Hari[3]:='Rabu'; Hari[4]:='Kamis'; Hari[5]:='Jumat'; Hari[6]:='Sabtu'; Hari[7]:='Minggu'; Repeat Write('Hari Keberapa ?'); Readln(K); If (K>0)and(K<8) then Writeln('Hari',Hari[K]); until K=0; End.

Hasil Latihan 3

4. LATIHAN 4 Program TinggiBadan; Const Maks=100; Var Nama : Array[1..Maks]of string; Tinggi: Array[1..Maks]of real; n,j:integer; Begin Write('Berapa Siswa: ');Readln(N); Writeln('masukkan data-data siswa'); for j:=1 to n do Begin Write('Nama Siswa :');Readln(Nama[j]); write('Tinggi Badan:');Readln(Tinggi[j]); End; Writeln('Daftar Tinggi Badan Siswa'); Writeln('========================='); Writeln('No Nama Tinggi Badan'); Writeln('========================='); For j:=1 to n Do Writeln(j:3,Nama[j]:15,Tinggi[j]:10:2); Writeln('========================='); Readln End.

Hasil Latihan 4

5. LATIHAN 5 Program Umur_array; Uses crt; Var i:=integer; rata_umur,tot_umur:real; Nama:array[1..5]of string; umur:array[1...5]of integer; Begin {---Memasukkan Data---} clrscr; For i:=1 to 5 do Begin Writeln('Data Ke:',i); Writeln; Write('Nama:');Readln(nama[i]); Write('Umur:');Readln(umur[i]); Writeln; End; Writeln; {---Buat Tabel---} Writeln('Tabel Siswa'); Writeln; Writeln('==========================='); Writeln('No Nama Umur '); Writeln('==========================='); For i :=1 to 5 do Begin {---Tampilkan data dalam tabel---} Writeln(i:3,nama[i]:13,umur[13]); Tot_umur:=Tot_umur+umur[i];{--Hitung Jumlah Umur--} rata_umur:=Tot_umur/5;{--Hitung rata rata--} end; Writeln('==========================='); Writeln('Jumlah Umur:',Tot_umur:2:2); Writeln('Rata Umur:',rata_umur:2:2); Readln; End.

Hasil Latihan 5

Tugas Program Nota_Belanja; Uses Crt; Var i : integer; Tot_bel : real; NamBar : array [1..3] of string; Jumlah : array [1..3] of integer; Harga : array [1..3] of integer; JumHar : array [1..3] of integer; Begin {--- Memasukkan Data --- } ClrScr; For i:= 1 to 3 do begin Writeln (' Data ke : ',i); Writeln; Write (' Nama Barang : '); Readln (NamBar[i]); Write (' Jumlah

: '); Readln (Jumlah[i]);

Write (' Harga

: '); Readln (Harga[i]);

Write (' Jumlah Harga : '); Readln (JumHar[i]); Writeln;

Writeln (''); end; Writeln; Writeln (' Toko Mu '); Writeln (' Jl.Mayjend Bambang Soegeng 14 '); Writeln; Writeln (' Nota Belanja '); {--- Buat Tabel ---} Writeln (' ============================================================== '); Writeln (' No Nama Barang

Jumlah

Harga

Jumlah Harga ');

Writeln (' ============================================================== '); For i:= 1 to 3 do begin {--- Tampilkan data dalam tabel ---} Writeln (i:3, NamBar[i]:16, Jumlah[i]:12, Harga[i]:12, JumHar[i]:13); Tot_bel:= Tot_bel + JumHar[i]; {-- Hitung Jumlah Umur --} end;

Writeln (' ============================================================== '); Writeln (' 2:0 ); Readln; End.

Total Belanja : ', Tot_bel :

Hasil Tugas

Similar documents

modul 7

Malik Alfiyan - 76.3 KB

TAREA 7

Natali Rodriguez - 4.3 MB

Modul Powerpoint

Mekar Meina - 1.6 MB

MODUL 6

jeky lani - 138.1 KB

Tarea 7

victor carrasco - 171.5 KB

Modul 5

Simar Kurniawan - 1.4 MB

MKA_APPinvertor_DZ_06_1544024844 (7)

Артем Соломко - 470.1 KB

002_Curs 7

Bugetuh Bcrjjcf - 867.3 KB

Modul VI

Ra- Koon - 89.5 KB

MODUL 5

jeky lani - 138.1 KB

Modul 8

terbit cerah - 696.2 KB

MODUL 2

Ryan Mcdonald - 313 KB

© 2024 VDOCS.RO. Our members: VDOCS.TIPS [GLOBAL] | VDOCS.CZ [CZ] | VDOCS.MX [ES] | VDOCS.PL [PL] | VDOCS.RO [RO]