Tugas Pencarian Data
Tugas Pencarian Data
KLASIBER: PENCARIAN
Disusun:
BELLA AZIS DEWANTI PUTRI
15522076
Sub no1()
Jumlah = 0
For Baris = 1 to 10
If Cells(Baris,1).Value = 7 Then
Jumlah = Jumlah + 1
End If
Next Baris
MsgBox “Jumlah angka 7 =” & Jumlah
End Sub
MULAI
JUMLAH = 0
BARIS = 1
CELLS(BARIS,1) = 7?
FALSE
TRUE
JUMLAH = JUMLAH + 1
BARIS = BARIS + 1
FALSE
BARIS > 10?
TRUE
JUMLAH
SELESAI
2. SOAL NOMOR 2
Sub no2()
Jumlah = 0
For Baris = 3 to 100
If Cells(Baris,1).Value = 7 Then
Jumlah = Jumlah + 1
End If
Next Baris
MsgBox “Jumlah Angka 7 =” & Jumlah
End Sub
MULAI
JUMLAH = 0
BARIS = 3
CELLS(BARIS,1) = 7?
FALSE
TRUE
JUMLAH = JUMLAH + 1
BARIS = BARIS + 1
FALSE
BARIS > 100?
TRUE
JUMLAH
SELESAI
3. SOAL NOMOR 3
Sub no3()
Jumlah = 0
For Kolom = 1 to 10
If Cells(1,Kolom).Value = 5 Then
Jumlah = Jumlah + 1
End If
Next Kolom
MsgBox “Jumlah Angka 5 =” & Jumlah
End Sub
MULAI
JUMLAH = 0
KOLOM = 1
CELLS(1,KOLOM) = 5?
FALSE
TRUE
JUMLAH = JUMLAH + 1
KOLOM = KOLOM + 1
FALSE
KOLOM > 10?
TRUE
JUMLAH
SELESAI
4. SOAL NOMOR 4
Sub no4()
Jumlah = 0
For Kolom = 2 to 100
If Cells(1,Kolom).Value = 5 Then
Jumlah = Jumlah + 1
End If
Next Kolom
MsgBox “Jumlah Angka 5 =” & Jumlah
End Sub
MULAI
JUMLAH = 0
KOLOM = 2
CELLS(1,KOLOM) = 5?
FALSE
TRUE
JUMLAH = JUMLAH + 1
KOLOM = KOLOM + 1
FALSE
KOLOM > 100?
TRUE
JUMLAH
SELESAI
5. SOAL NOMOR 5
Sub no5()
Jumlah = 0
For Baris = 1 to 10
For Kolom = 1 to 10
If Cells(Baris,Kolom).Value = 3 Then
Jumlah = Jumlah + 1
End If
Next Kolom
Next Baris
MsgBox “Jumlah Angka 3 =” & Jumlah
End Sub
MULAI
JUMLAH = 0
KOLOM = 0
BARIS = 0
KOLOM = KOLOM + 1
FALSE
CELLS(BARIS,KOLOM) = 3?
TRUE
JUMLAH = JUMLAH + 1
BARIS = BARIS + 1
FALSE
BARIS > 10?
TRUE
KOLOM = KOLOM + 1
FALSE
KOLOM > 10?
TRUE
JUMLAH
SELESAI
6. SOAL NOMOR 6
Sub no6()
Jumlah = 0
For Baris = 1 to 10
For Kolom = 1 to 10
If Cells(Baris,Kolom).Value = 3 Then
Jumlah = Jumlah + 1
End If
Next Kolom
Next Baris
MsgBox “Jumlah Angka 3 =” & Jumlah
End Sub
MULAI
JUMLAH = 0
KOLOM = 0
BARIS = 0
KOLOM = KOLOM + 1
FALSE
CELLS(BARIS,KOLOM) = 3?
TRUE
JUMLAH = JUMLAH + 1
BARIS = BARIS + 1
FALSE
BARIS > 10?
TRUE
KOLOM = KOLOM + 1
FALSE
KOLOM > 10?
TRUE
JUMLAH
SELESAI
7. Nilai Minimum Data
Sub no7()
Min = (1,1).Value
For Baris = 1 to 10
For Kolom = 1 to 10
If Min = Cells(Baris,Kolom).Value<Min Then
Min = Cells(Baris,Kolom).Value
End If
Next Kolom
Next Baris
MsgBox “Nilai Minimum Data adalah” & Min
End Sub
Sub no8()
Max = (1,1).Value
For Baris = 1 to 10
For Kolom = 1 to 10
If Max = Cells(Baris,Kolom).Value>Max Then
Max = Cells(Baris,Kolom).Value
End If
Next Kolom
Next Baris
MsgBox “Nilai Maksimum Data adalah” & Max
End Sub
Sub no9()
Total = 0
For Baris = 1 to 10
For Kolom = 0 to 10
Total = Total + Cells(Baris,Kolom).Value
Next Kolom
Next Baris
MsgBox “Total Data” & Total
End Sub
10. Nilai Rata-Rata Data
Sub no10()
Total = 0
Jumlah = 0
For Baris = 1 to 10
For Kolom = 1 to 10
Total = Total + Cells(Baris,Kolom).Value
Jumlah = Jumlah +1
Next Kolom
Next Baris
Rata = Total/Jumlah
MsgBox “Rata-rata Data” & Rata
End Sub