#CSCI 152 Mini Quiz 1 #------------------------------------------------------------------ #The program is partially written for you. You ONLY need to complete #functions process and main #------------------------------------------------------------------ #Program Descriptiona and Requirements: #A certain medical insurance plan covers each medical procedure according to the following rule: #insurance pays 75% after 15 dollars deductible. So, for each procedure, the patient pays $15 plus the 25% #of the remaining cost. #For example, if the full cost of the procedure is 120 dollars, then #patient pays 15 + 25*(120-15)/100 = 41.25 dollars #insurance pays (120-15)*75/100 = 78.75 (which is 120-41.25) #Write a program that reads a number of the procedures done in one year. The program randomly #generates the cost for each procedure and store all costs in the list. #The program then calculates the patient portion and the insurance portion for each procedure. The results #are stored in two separate lists. The program also finds the #average amount patient paid for procedure and the total amount patient paid per year for all procedures, #and the average amount insurance paid for procedure and the total amount insurance paid per year. #Design: #make_list(size, min_limit, max_limit) - written for you #process(my_list) - that has ONE paremeter - list of procedure costs. The #function creates amd returns TWO new lists: list of patient portions and list of insurance portions #sum_average(my_list) - written for you, this function returns sum and average #main - partially written: reads a number of medical procedures per year, generates a list of #procedure costs, calls function process to find patient portion and insurance portion and prints the #results. #The program also finds the #average amount patient paid for procedure and the total amount patient paid per year, and the average #amount insurance paid for procedure and the total amount insurance paid per year. #Example: #size 4, procedure_cost=[15, 50, 70, 156] #partient=[15, 23.75, 28.75, 50.25] #insurance=[0, 26.25, 41.25, 105.75] #average_patient=29.44 #average_insurance=43.31 #total_patient=117.75 #total_insurance=173.25 import random def make_list(size, min_limit, max_limit): my_list=[] for i in range(size): n=random.randint(min_limit, max_limit) my_list.append(n) return my_list def sum_average(my_list): sum=0 length=len(my_list) for i in range(length): sum+=my_list[i] #returns sum and average return sum, sum/length def process(my_list): #complete this function def main(): size=int(input("enter the number of medical procedures per year ")) #ASSUME size>0 procedure_cost = make_list(size, 15, 200) print("full cost of procedures ") print(procedure_cost) #complete main #find and print the list of patient portion and list of insurance portion #average price patient paid #average price insurance paid #total patient paid #total insurance paid #PAY ATTENTION: You would need to call function sum_average several times. Also, pay attention #function sum_average returns two values: sum of list elements and average of list elements main()