Professional Documents
Culture Documents
Pseudocode : Numbers
Declarations
Variables
values[100] - data type real
New_tot, Tot - data type real
Process
Tot ← 0.0
FOR count ← 0 to 99 DO
Display “Enter a number.”
Read numvalues[count]
Tot← Tot+numvalues[count]
ENDFOR
Function reverse(value[])
//displays numbers entered in reverse order
Declarations
Parameters
values[ ] - data type real // value parameter
Variables
count - data type integer
Process
FOR count← 100 to 0 Step -1 DO
Display values[count]
Endfor
Stop
Function avg(tot)
Declarations
Parameters
Tot - data type real //variable parameter
Variables
avg - data type
Process
avg← Tot/100
Display “The average of these numbers is:” ,avg
Stop