Answer to Question #204054 in Algorithms for Khojo

Question #204054

Write the algorithm and pseudocode for finding the average of five(5) numbers.


1
Expert's answer
2021-06-07T01:58:51-0400
Algorithm:


Step 1 Create variable called number
Step 2 Create variable called sum
Step 3 Create variable called average
Step 4 for i := 1 to 5 Step 1 do 
Step 5     Get number from the user
Step 6     sum := sum+ number
Step 7 average := sum/5
Step 8 Display average


Pseudocode:
	
Start
	number = 0
	sum =0
	average= 0
	for i = 1 i<= 5
		Display message: "Enter the number: "
		Input number
		sum = sum + number
	average  = sum / 5
	Display message: "Average is: ", average
Stop

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS