| 1 |
nino.borges |
653 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
SplitTheCheck.py
|
| 4 |
|
|
|
| 5 |
|
|
Created by
|
| 6 |
|
|
|
| 7 |
|
|
Emanuel Borges
|
| 8 |
|
|
04.11.2014
|
| 9 |
|
|
|
| 10 |
|
|
"""
|
| 11 |
|
|
|
| 12 |
|
|
|
| 13 |
|
|
def RatioEquation(subTotalNoTax,finalTotal, individualPerson):
|
| 14 |
|
|
return(finalTotal*individualPerson)/subTotalNoTax
|
| 15 |
|
|
|
| 16 |
|
|
if __name__ == '__main__':
|
| 17 |
|
|
|
| 18 |
|
|
personA = [2.63,8.99]
|
| 19 |
|
|
personB = [8.22,22.33]
|
| 20 |
|
|
personC = [5.22,9.99]
|
| 21 |
|
|
|
| 22 |
|
|
tax = 2.84
|
| 23 |
|
|
|
| 24 |
|
|
tip = 12
|
| 25 |
|
|
|
| 26 |
|
|
|
| 27 |
|
|
## Total of all food items without tax and tip
|
| 28 |
|
|
subTotalNoTax = 57.18
|
| 29 |
|
|
|
| 30 |
|
|
## Final total with everything including tip and tax
|
| 31 |
|
|
finalTotal = 72.02
|
| 32 |
|
|
|
| 33 |
|
|
## The total for one person without tip and tax
|
| 34 |
|
|
singlePersonTotal = 14.95
|
| 35 |
|
|
|
| 36 |
|
|
print RatioEquation(subTotalNoTax,finaltotal,singlePersonTotal) |