From f3cdb4ec3a62187cbb67b3d113fb46c29f951775 Mon Sep 17 00:00:00 2001 From: bwalterscoding <40584788+bwalterscoding@users.noreply.github.com> Date: Mon, 6 Aug 2018 10:15:48 -0400 Subject: Add files via upload this has comments in the code and will repeat itself after the last command executes --- pizza2.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pizza2.py b/pizza2.py index ab09890..d80b5dc 100644 --- a/pizza2.py +++ b/pizza2.py @@ -1,10 +1,12 @@ -gas_price = 2.6 -wear_tear = 0.1 -mpg = 30 -total_price = float(input('Total Price: ')) -amt_given = float(input('Amount Given: ')) -tip = amt_given - total_price -print('Tip given = {}'.format(tip)) -trip_distance = float(input('Miles: ')) -print (tip-(gas_price / trip_distance + tip * wear_tear)) - +while True: + gas_price = 2.6 #Avg gas price in NC + wear_tear = 0.1 #estimated 10 cents per mile in tire and engine wear + mpg = 30 # my car gets 30 miles per gallon + delivery_charge = 1.25 #dominos pays the driver $1.25 each delivery + total_price = float(input('Total Price: ')) #Total price of order + amt_given = float(input('Amount Given: ')) #Total amount of money received from customer + tip = amt_given - total_price #This is your total Gross Tip + print('Tip given = {}'.format(tip)) #This prints your tip and saves the tip as a variable ( I think..lol) + trip_distance = float(input('Miles: ')) # This is your round trip distance in miles + print (tip + delivery_charge -(gas_price / trip_distance + tip * wear_tear)) #This prints your Net Tip after factoring in the delivery charge, gas, and wear n tear + -- cgit v1.3