#Structured programming Worksheet 2 Qu 4 written without subroutines #program to find the maximums of sets of three numbers #until the user enters three zeroes #It then calculates and outputs the average of the maximums total = 0 n=0 print ( """ program finds the maximums of sets of three numbers.\n Enter three zeroes when all numbers entered.\n Proram then calculates and outputs the average of the maximums """ ) print("Please enter first number ") num1 = int(input()) print("Please enter second number ") num2 = int(input()) print("Please enter third number ") num3 = int(input()) while num1!=0 and num2!=0 and num3!=0: max = num1 if num2>max: max = num2 if num3>max: max = num3 #endif print ("Max of the three numbers is is ",max) total = total + max n=n+1 print("Please enter first number ") num1 = int(input()) print("Please enter second number ") num2 = int(input()) print("Please enter third number ") num3 = int(input()) #endwhile average = total/n print("Average of maximums is ",average)