Create a function that returns the total of a meal including tip and tax. You should not tip on the tax.

You will be given the subtotal, the tax as a percentage and the tip as a percentage. Please round your result to two decimal places.

Difficulty: introductory

Starter code:

def calculate_total(subtotal, tax, tip):
	

Solutions:
def calculate_total(subtotal, tax, tip):
    return round(subtotal * ( 1 + tax / 100.0 + tip /100.0), 2)

def calculate_total(subtotal, tax, tip):
    return round((1 + (tip + tax) / 100.0) * subtotal, 2)

def calculate_total(subtotal, tax, tip):
    tax = tax/100 * subtotal
    tip = tip/100 * subtotal
    return round(subtotal + tax + tip, 2)

def calculate_total(subtotal, tax, tip):
    return round(subtotal * (100 + tax + tip)/100, 2)

def calculate_total(subtotal, tax, tip):
    return float("{0:.2f}".format(subtotal + subtotal*(tax+tip)/100))

def calculate_total(subtotal, tax, tip):
    meal = subtotal*(1+(tax+tip)/100)
    return round(meal,2)

def calculate_total(subtotal, tax, tip):
    return round(subtotal + tax / 100 * subtotal + tip / 100 * subtotal, 2)

def percentage(value, percent):
    return value * percent / 100

def calculate_total(subtotal, tax, tip):
    total = subtotal + percentage(subtotal, tax) + percentage(subtotal, tip)
    return round(total, 2)


def calculate_total(subtotal, tax, tip):
    return round(subtotal * (100 + tip + tax) / 100, 2)

def calculate_total(subtotal, tax, tip):
    tax = (tax/100.00) * subtotal
    tip = (tip/100.00) * subtotal
    return round(subtotal + tip + tax, 2)