#AAA offers 3 types of membership: # Basic: 29.50 + tax per year # Plus: 62.50 + tax per year # Premium: 95.50 + tax per year #Write a program that first reads the number of family members with AAA #membership and the tax. Then, the program reads the type of the #membership for each family member. Assume that 1 idicates Basic membership, #2 - Plus membership, and 3 - Premium membership. #Assume the input is valid. The #program finds the total price the family pays per year and the average #membership price. YOU HAVE TO USE LOOP WHILE IN THIS PROGRAM. #Functions: total(family_size, tax) - this function will read the type of #the membership for each family member. Function finds and returns the total #paid per year #In the main we will use function total and find the average def total(family_size, tax): sum=0 i=1 while(i<=family_size): print("enter membership type for family member", i) type=int(input("")) if(type==1): price=29.50*(1+tax/100) elif(type==2): price=62.50*(1+tax/100) else: price=95.50*(1+tax/100) sum=sum+price i=i+1 return sum def main(): family_size=int(input("enter family size ")) tax=int(input("enter tax ")) if(family_size>0 and tax>=0): total_price=total(family_size, tax) #function call average=total_price/family_size print("total", total_price, "average", average) else: print("invalid input") main()