# Arup Guha
# 6/7/2022
# Lemonade edit to incorporate weather!

import random

#Constants used for the problem.
COST_SUGAR = 25
COST_LEMON = 10
LEMONS_PER_PITCHER = 20
CUPS_PER_PITCHER = 8

#get user input.
numPitchers = int(input('How many pitchers are you making?\n'))
costCup = int(input('What is the cost per cup of lemonade, in cents?\n'))

#Calculate cost of one pitcher - add sugar cost and lemon cost.
pitcherCost = COST_SUGAR + LEMONS_PER_PITCHER*COST_LEMON

#Calculate the cost of all the pitchers, this is your total cost.
totalCost = numPitchers*pitcherCost

#Calculate the maximum # of cups I can sell.
maxCups = numPitchers*CUPS_PER_PITCHER

# Randomly generate the weather.
weather = random.randint(1, 3)

# Total # of cups sold based on weather.
cupsSold = random.randint(((weather-1)*maxCups)//3, (weather*maxCups)//3 )

# Let's see how many we sold.
print("Based on the weather level,", weather," you sold",cupsSold,"number of cups.")

# This is how much I earned.
totalRevenue = cupsSold*costCup

# Calculate profit.
profit = totalRevenue - totalCost

# Print out profit in cents
print("You made",profit,"cents!")

