# John-Michael O'Brien
# w1890922
# CISP 300
# 2/20/20
# This program calculates the tip, tax, and total price for a meal.
# The tip percentage depends on the meal price. The tax rate is 6%.
# The total is the meal price plus the tip plus the tax.

# This program uses functions and variables

# The main function
def main():
    print('Welcome to the meal calculator program')
    print() # prints a blank line
    mealPrice = inputMeal()
    tip = calcTip(mealPrice)
    tax = calcTax(mealPrice)
    total = calcTotal(mealPrice, tip, tax)
    printInfo(mealPrice, tip, tax, total)
    
# This function will input meal price
def inputMeal():
    mealPrice = input('Enter the meal price $')
    mealPrice = float(mealPrice)                                               
    return mealPrice

# This function will calculate tip
def calcTip(mealPrice):
    if mealPrice >= .01 and mealPrice <= 5.99:
        tip = mealPrice * .10
    elif mealPrice >= 6.00 and mealPrice <= 12.00:
        tip = mealPrice * .13
    elif mealPrice >= 12.01 and mealPrice <= 17.00:
        tip = mealPrice * .16
    elif mealPrice >= 17.01 and mealPrice <= 25.00:
        tip = mealPrice * .19
    else:
        tip = mealPrice * .22
    return tip
     
# This function will calculate tax at 6%
def calcTax(mealPrice):
    tax = mealPrice * .06
    return tax
    
# This function will calculate tip, tax, and the total cost
def calcTotal(mealPrice, tip, tax):
    total = mealPrice + tip + tax
    return total

# This function will print tip, tax, the meal price, and the total
def printInfo(mealPrice, tip, tax, total):
    print ('The meal price is $',mealPrice)
    print ('The tip is $',tip)
    print ('The tax is $',tax)
    print ('The total is $',total)
    
# calls main
main() 

47ce95740f26099dd745739b34c2e0c737eaea4f
def main():
    print('Welcome to the meal calculator program')
    print()
    mealPrice = inputMeal()
    tip = calcTip(mealPrice)
    tax = calcTax(mealPrice)
    total = calcTotal(mealPrice, tip, tax)
    printInfo(mealPrice, tip, tax, total)


def inputMeal():
    mealPrice = input('Enter the meal price $')
    mealPrice = float(mealPrice)
    return mealPrice


def calcTip(mealPrice):
    if mealPrice >= 0.01 and mealPrice <= 5.99:
        tip = mealPrice * 0.1
    elif mealPrice >= 6.0 and mealPrice <= 12.0:
        tip = mealPrice * 0.13
    elif mealPrice >= 12.01 and mealPrice <= 17.0:
        tip = mealPrice * 0.16
    elif mealPrice >= 17.01 and mealPrice <= 25.0:
        tip = mealPrice * 0.19
    else:
        tip = mealPrice * 0.22
    return tip


def calcTax(mealPrice):
    tax = mealPrice * 0.06
    return tax


<mask token>

def main():
    print('Welcome to the meal calculator program')
    print()
    mealPrice = inputMeal()
    tip = calcTip(mealPrice)
    tax = calcTax(mealPrice)
    total = calcTotal(mealPrice, tip, tax)
    printInfo(mealPrice, tip, tax, total)


def inputMeal():
    mealPrice = input('Enter the meal price $')
    mealPrice = float(mealPrice)
    return mealPrice


def calcTip(mealPrice):
    if mealPrice >= 0.01 and mealPrice <= 5.99:
        tip = mealPrice * 0.1
    elif mealPrice >= 6.0 and mealPrice <= 12.0:
        tip = mealPrice * 0.13
    elif mealPrice >= 12.01 and mealPrice <= 17.0:
        tip = mealPrice * 0.16
    elif mealPrice >= 17.01 and mealPrice <= 25.0:
        tip = mealPrice * 0.19
    else:
        tip = mealPrice * 0.22
    return tip


def calcTax(mealPrice):
    tax = mealPrice * 0.06
    return tax


def calcTotal(mealPrice, tip, tax):
    total = mealPrice + tip + tax
    return total


<mask token>

def main():
    print('Welcome to the meal calculator program')
    print()
    mealPrice = inputMeal()
    tip = calcTip(mealPrice)
    tax = calcTax(mealPrice)
    total = calcTotal(mealPrice, tip, tax)
    printInfo(mealPrice, tip, tax, total)


def inputMeal():
    mealPrice = input('Enter the meal price $')
    mealPrice = float(mealPrice)
    return mealPrice


def calcTip(mealPrice):
    if mealPrice >= 0.01 and mealPrice <= 5.99:
        tip = mealPrice * 0.1
    elif mealPrice >= 6.0 and mealPrice <= 12.0:
        tip = mealPrice * 0.13
    elif mealPrice >= 12.01 and mealPrice <= 17.0:
        tip = mealPrice * 0.16
    elif mealPrice >= 17.01 and mealPrice <= 25.0:
        tip = mealPrice * 0.19
    else:
        tip = mealPrice * 0.22
    return tip


def calcTax(mealPrice):
    tax = mealPrice * 0.06
    return tax


def calcTotal(mealPrice, tip, tax):
    total = mealPrice + tip + tax
    return total


def printInfo(mealPrice, tip, tax, total):
    print('The meal price is $', mealPrice)
    print('The tip is $', tip)
    print('The tax is $', tax)
    print('The total is $', total)


<mask token>

def main():
    print('Welcome to the meal calculator program')
    print()
    mealPrice = inputMeal()
    tip = calcTip(mealPrice)
    tax = calcTax(mealPrice)
    total = calcTotal(mealPrice, tip, tax)
    printInfo(mealPrice, tip, tax, total)


def inputMeal():
    mealPrice = input('Enter the meal price $')
    mealPrice = float(mealPrice)
    return mealPrice


def calcTip(mealPrice):
    if mealPrice >= 0.01 and mealPrice <= 5.99:
        tip = mealPrice * 0.1
    elif mealPrice >= 6.0 and mealPrice <= 12.0:
        tip = mealPrice * 0.13
    elif mealPrice >= 12.01 and mealPrice <= 17.0:
        tip = mealPrice * 0.16
    elif mealPrice >= 17.01 and mealPrice <= 25.0:
        tip = mealPrice * 0.19
    else:
        tip = mealPrice * 0.22
    return tip


def calcTax(mealPrice):
    tax = mealPrice * 0.06
    return tax


def calcTotal(mealPrice, tip, tax):
    total = mealPrice + tip + tax
    return total


def printInfo(mealPrice, tip, tax, total):
    print('The meal price is $', mealPrice)
    print('The tip is $', tip)
    print('The tax is $', tax)
    print('The total is $', total)


main()

# John-Michael O'Brien
# w1890922
# CISP 300
# 2/20/20
# This program calculates the tip, tax, and total price for a meal.
# The tip percentage depends on the meal price. The tax rate is 6%.
# The total is the meal price plus the tip plus the tax.

# This program uses functions and variables

# The main function
def main():
    print('Welcome to the meal calculator program')
    print() # prints a blank line
    mealPrice = inputMeal()
    tip = calcTip(mealPrice)
    tax = calcTax(mealPrice)
    total = calcTotal(mealPrice, tip, tax)
    printInfo(mealPrice, tip, tax, total)
    
# This function will input meal price
def inputMeal():
    mealPrice = input('Enter the meal price $')
    mealPrice = float(mealPrice)                                               
    return mealPrice

# This function will calculate tip
def calcTip(mealPrice):
    if mealPrice >= .01 and mealPrice <= 5.99:
        tip = mealPrice * .10
    elif mealPrice >= 6.00 and mealPrice <= 12.00:
        tip = mealPrice * .13
    elif mealPrice >= 12.01 and mealPrice <= 17.00:
        tip = mealPrice * .16
    elif mealPrice >= 17.01 and mealPrice <= 25.00:
        tip = mealPrice * .19
    else:
        tip = mealPrice * .22
    return tip
     
# This function will calculate tax at 6%
def calcTax(mealPrice):
    tax = mealPrice * .06
    return tax
    
# This function will calculate tip, tax, and the total cost
def calcTotal(mealPrice, tip, tax):
    total = mealPrice + tip + tax
    return total

# This function will print tip, tax, the meal price, and the total
def printInfo(mealPrice, tip, tax, total):
    print ('The meal price is $',mealPrice)
    print ('The tip is $',tip)
    print ('The tax is $',tax)
    print ('The total is $',total)
    
# calls main
main() 
