Answer:
#Function for the calculcations needed
function subtotal_gratuity_total(subtotal,gratuity_rate):
gratuity_rate = gratuity_rate/100 #this is assuming the user enters the gratuity as a percentage value (e.g. 15)
gratuity = subtotal*gratuity_rate
total = subtotal+gratuity
return subtotal, gratuity_rate, gratuity, total
#Reading the values the user enters
Output(“Input subtotal”)
input (subtotal)
Output(“Input gratuity rate”)
input (gratuity_rate)
#Calling function we created with the values the user enters as inputs,
#and the 4 values required as outputs
subtotal,gratuity_rate,gratuity, total = subtotal_gratuity_total(subtotal,gratuity_rate)