Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #start
- ''' Hydration Meter '''
- #staticVars
- MYTH_OUNCES = 64
- MYTH_CUPS = 8
- #inputVars
- dailyCups = int(input("How many cups of water do you drink per day? "))
- cupOunces = float(input("How many ounces is a single cup? "))
- #tempVars
- cups = 0
- ounces = 0
- h2o_level = 0
- #conditionSets
- # 1 #
- if (dailyCups < MYTH_CUPS):
- if cupOunces < MYTH_CUPS:
- ounces = MYTH_OUNCES - (cupOunces * dailyCups)
- cups = float(f'{ounces / cupOunces:.2}')
- h2o_level = (f"You drink {ounces}oz less water than the daily recommended amount of {MYTH_OUNCES}oz, so you need about {cups} more {cupOunces}oz cups.")
- if cupOunces == MYTH_CUPS:
- ounces = (cupOunces * dailyCups)
- cups = float(f'{cupOunces / MYTH_CUPS:.2}')
- h2o_level = (f"You drink {ounces}oz of water which is less than {MYTH_OUNCES}oz, so you'll need to drink about {cups} more {cupOunces}oz cups.")
- if cupOunces > MYTH_CUPS and dailyCups * cupOunces == MYTH_OUNCES:
- ounces = MYTH_OUNCES
- h2o_level = (f"You drink {ounces}oz of water per day, which is the daily recommended amount.")
- else:
- if cupOunces > MYTH_CUPS:
- ounces = (cupOunces * dailyCups) - MYTH_OUNCES
- cups = (f'{ounces / MYTH_CUPS}')
- h2o_level = (f"You drink {ounces}oz more than {MYTH_OUNCES}oz, which is about {cups} cups more than the daily recommended amount of water.")
- # 2 #
- if (dailyCups == MYTH_CUPS):
- if cupOunces < MYTH_CUPS:
- ounces = MYTH_OUNCES - (cupOunces * dailyCups)
- cups = float(f'{ounces / MYTH_CUPS:.2}')
- h2o_level = (f"You drink {ounces}oz less water than the daily recommended amount of {MYTH_OUNCES}oz, so you'll need to drink about {cups} more {cupOunces}oz cups.")
- if cupOunces == MYTH_CUPS:
- ounces = (cupOunces * dailyCups)
- h2o_level = (f"You drink {ounces}oz of water per day, which is the daily recommended amount.")
- if cupOunces > MYTH_CUPS:
- ounces = (cupOunces * dailyCups) - MYTH_OUNCES
- cups = float(f'{ounces / MYTH_CUPS:.2}')
- h2o_level = (f"You drink {ounces}oz more than {MYTH_OUNCES}oz, which is about {cups} cups more than the daily recommended amount of water.")
- # 3 #
- if (dailyCups > MYTH_CUPS):
- if cupOunces < MYTH_CUPS and dailyCups * cupOunces == MYTH_OUNCES:
- ounces = MYTH_OUNCES
- h2o_level = (f"You drink {ounces}oz of water per day, which is the daily recommended amount.")
- elif MYTH_OUNCES > (cupOunces * dailyCups):
- ounces = MYTH_OUNCES - (cupOunces * dailyCups)
- cups = float(f'{ounces / cupOunces:.2}')
- h2o_level = (f"You drink {ounces}oz less water than the daily recommended amount of {MYTH_OUNCES}oz, so you'll need to drink about {cups} more {cupOunces}oz cups.")
- else:
- if cupOunces < MYTH_CUPS:
- ounces = (cupOunces * dailyCups) - MYTH_OUNCES
- cups = float(f'{ounces / cupOunces:.2}')
- h2o_level = (f"You drink {ounces}oz more water than the daily recommended amount of {MYTH_OUNCES}oz.")
- if cupOunces == MYTH_CUPS:
- ounces = (cupOunces * dailyCups) - MYTH_OUNCES
- cups = float(f'{ounces / MYTH_CUPS:.2}')
- h2o_level = (f"You drink {ounces}oz more than {MYTH_OUNCES}oz, which is about {cups} cups more than the daily recommended amount of water.")
- if cupOunces > MYTH_CUPS:
- ounces = (cupOunces * dailyCups) - MYTH_OUNCES
- cups = (f'{ounces // MYTH_CUPS}')
- h2o_level = (f"You drink {ounces}oz more than {MYTH_OUNCES}oz, which is about {cups} cups more than the daily recommended amount of water.")
- #end_conditions
- #totalVars
- TOTAL_LEVEL = h2o_level
- #outPut
- print(f"{TOTAL_LEVEL}")
- #end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement