14 - TI 1F - IQRI MANNISA' BUCHORI (Arr)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

L atihan 1 Flowchart (a) START

Int Adi [][] = new int [4][4]

Int totalA [] = new int [4]

Int totalB [] = new int [4]

Int pendapatan [] = new int [4]

Int i=0

i < Adi.length

j=0

j < Adi[0].length

Output “Masukkan Banyak


Kue ke ["+i+"]["+j+"] = "

Input Adi [i] [j]

totalA[i] += Adi [i][j]

i++

j++

Print totalA[i]

B
Latihan 1 Flowchart (b)

Int j=0

j < Adi.length

i=0

i < Adi[0].length

Output “Masukkan Banyak


Kue ke ["+i+"]["+j+"] = "

Input Adi [i] [j]

totalB [i] += Adi [i][j]

j++

i++

Print totalB [i]

C
Latihan 1 Flowchart (c)

pendapatan [0] += totalB[0] * 3000 ;

pendapatan [1] += totalB[1] * 2500;

pendapatan [2] += totalB[2] * 4000;

pendapatan [3] += totalB[3] * 4500;

Int i=0

i < Adi.length

Output "Jumlah pendapatan


Kue Adi " +pendapatan[i]

i++

Finish
Start

Latihan 2Flowchart
Int i, j, n, m, posisi1, posisi2, total, LB, PB,
LT, LB

Int [] [] posisi = new int [n] [m]

Input [n] [m]

i =0

i < posisi.length

i ++
j=0

j < posis[0]i.length

Posisi 1+= posisi [n] [m]

Print posisi1

Posisi [n] [m]

Posisi 2+= posisi [n] [m]

Print posisi2

j++
A

i == 0

Total LB, PB, LT, PT

i == 4

Total LB, PB, LT, PT

Print total
Latihan 3 Flowchart (a)

Start

Int [][] a = new int [5][5]

Int x=0

X<a.length

X++ Int y=0

y<a.length[0]

If ( x==1 ||
x==a.length ||
y==1 ||
y==a[0].length)
y++

Output (" ")

Output ("*")
Output ()

Finish
Latihan 3 Flowchart (b) Start

Int a, b, c, d, e, f, g, jumlah;

Int [] [] hasil = new int [][]

Int [] [] riry = new int [d] [e]

Int [] [] arrai2 = new int [f] [g]


Input arrai2 [f] [g]

a=0
Input riry [d] [e]

a<riry.length
A

b=0

a++

b<riry[0].length

Input riry [a] [b]

b++
A a=0

a<arrai2.length
a=0

a++ b=0 a<arrai2.length


B

b<arrai2[0].length
b=0 a++

b++

Input arrai2 [a] [b]


b<arrai2[0].length

C =0

b++

Hasil [a] [b]= jumlah

Jumlah = 0

C =arrai2[0].length

Jumlah = jumlah * riry[a] [b]*


arrai2 [c] [i]

c++
B a=0

a<riry.length

b=0

b++

b<riry[0].length
Ouput hasil
[a][b]

Output ( )

a++

Finish

You might also like