Answer to Question #143307 in Algorithms for Abigale Mcintosh

Question #143307
Write a structured algorithm to prompt the user to input the ages of four friends. The algorithm should allow the user to input the ages, find and print the average.
1
Expert's answer
2020-11-09T13:09:14-0500

For example, the algorithm in Python may look like this:

a = int(input("How old is your first friend? "))
b = int(input("How old is your second friend? "))
c = int(input("How old is your third friend? "))
d = int(input("How old is your fourth friend? "))
average = ((a+b+c+d)/4)
f = round(average, 2)
print("The average age of your friends is", f, "years")

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
APPROVED BY CLIENTS