''' DS2000 Spring 2023 Sample code from class - Jan 13th Weighted average and minutes/seconds Test cases: friendliness = 9.5 energy = 4.4 weighted avg = (.75)(9.5) + (.25)(4.4) = 8.225 minutes = 102 hours, minutes = 1 hour, 42 minutes ''' # These are constants - do not change them! FRIEND = .75 ENERGY = .25 def main(): # Gather data - prompt the user for Carol's friendliess and energy # and time at park friendliness = float(input("What is Carol's friendliness level (0-10)?\n")) energy = float(input("What is Carol's energy level (0-10)?\n")) minutes = int(input("How many minutes at the dog park this week?\n")) # Computation - compute the weighted average, and convert minutes # to hours & minutes weighted_avg = FRIEND * friendliness + ENERGY * energy hours = minutes // 60 minutes = minutes % 60 # Communication - report the results print("The weighted average is:", weighted_avg) print("Carol spent", hours, "hours and", minutes, "minutes at the dog park.") main()