# Allison Obourn
# CSC 110, Spring 2018
# Lecture 13

# This program calculates the total owed,
# assuming 8% tax / 15% tip

def main():
    people = int(input("How many people ate? "))
    subtotal = 0
    for i in range(1, people + 1):
        cost = float(input("Person #" + str(i) +
                     ": How much did your dinner cost? "))
        subtotal = subtotal + cost
    calc_total(subtotal)
    
# takes the subtotal of a meal cost as a parameter
# calculates and prints the tax, tip and total for
# that meal
def calc_total(subtotal):    
    print("Subtotal: ", end="")
    print(subtotal)

    tax = subtotal * .08
    print("Tax: ", end="")
    print(tax)

    tip = subtotal * .15
    print("Tip: ", end="")
    print(tip)

    print("Total: ", end="")
    print(subtotal + tip + tax)

main()
