1. BUATLAH ALGORITMA DAN SUBPROGRAM YANG CAR KERJANYA SEPERTIFUNCION POS DIATAS.
ALGORITMA : SUBPROGRAM
Deklarasi :
c,i,j,kali,proses,masuk,hasil=integer
Deskripsi :
Fungsi masuk(c[20],b[20]){
For i <-- to 2 do
For j <-- to 3do
Write(“Vaktor A”)
Write(“Vaktor B”)}
Fungsi proses(c[20],b[20]){
Write(“Vaktor A”)
For i <-- to 2 do
For j <-- to 3do
Write(b)
Write(“Vaktor B”)
For i <-- to 2 do
For j <-- to 3do
Write(c)
Write(“Vaktor C”)
For i <-- to 2 do
For j <-- to 3do
Hasil<-b+c
Write(hasil)
Write(“Vaktor Hasil Kali”)
For i <-- to 2 do
For j <-- to 3do
Kali<-b*hasil
Write(Kali)
Write(“Banyak Elemen”)
}
Write(“Menghitung Vaktor”)
Masuk(b,c)
Proses(b,c,hasil,kali)