The document contains pseudocode to calculate the sum, average, maximum, and minimum value of a data set. It initializes variables to store the number of data points, each value, the running sum, and the maximum and minimum observed values. It then loops through each data point, collecting the value, updating the running sum, and tracking the maximum and minimum. After all data points are processed, it calculates the average and prints the final values.
1 of 2
Download to read offline
More Related Content
Rata
1. Y
T
T
START
N=0 NILAI =0 RATA= 0
I= 0 JUMLAH =0 BESAR=0
KECIL=0
KECIL = 1000
N
I < N
I = I + 1
I
NILAI
JUMLAH = JUMLAH +NILAI
NILAI > BEASR BESAR=NILAI
NILAI > KECIL KECIL=NILAI
RATA = JUMLAH/N
JUMLAH,RATA, BEASR,KECIL
END
Y
T
2. DIM N, I, NILAI, JUMLAH, BESAR, KECIL AS INTEGER
DIM RATA AS SINGLE
CLS
KECIL = 1000
INPUT "JUMLAH DATA="; N
ULANG:
IF I < N THEN
I = I + 1
PRINT "DATA KE-"; I; "=";
INPUT NILAI
JUMLAH = JUMLAH + NILAI
IF NILAI > BESAR THEN
BESAR = NILAI
END IF
IF NILAI < KECIL THEN
KECIL = NILAI
END IF
GOTO ULANG
ELSE
RATA = JUMLAH / N
PRINT "JUMLAH NILAI="; JUMLAH
PRINT "RATA-RATA="; RATA
PRINT "NILAI TERBESAR="; BESAR
PRINT "NILAI TERKECIL="; KECIL
END
END IF