Question #212962

identify the purpose and components of the method represented in the pseudocode below:

num calAverage(num total)

declarations

num average

set average = total/2

return average


Expert's answer

The purpose of the function calAverage is to calculate and return the average of two numbers.

The sum of the two numbers is passed to the function as a parameter total.

The variable average is declared in the function and assigned a value obtained by dividing total by 2.

The function then returns average.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS