Nov-11-2018, 07:35 PM
Task:
manager of 5 stores.
determine the sales of the individual stores was from the last day.
Write a program that asks how much money was available in the 5 stores at the beginning of the day and how much money was in the cash register at the end of the day.
Calculate how much sales each store has made and which of the 5 stores has achieved the highest or lowest sales.
print the information for each store and determine the store with the largest and smallest sales.
What i did:
while True:
try:
store1beginning = int(input("Please enter the amount of money you have in the morning in store 1: "))
break
except:
print("Sorry, that wasn't correct. Please try again by entering a number: ")
store2beginning = int(input("Please enter the amount of money you have in the morning in store 2: "))
store3beginning = int(input("Please enter the amount of money you have in the morning in store 3: "))
store4beginning = int(input("Please enter the amount of money you have in the morning in store 4: "))
store5beginning = int(input("Please enter the amount of money you have in the morning in store 5: "))
moneyinthemorning=['store1beginning','store2beginning','store3beginning','store4beginning','store5beginning']
while True:
try:
store1end = int(input("Please enter the amount of money you have at the end of the day in store 1: "))
break
except:
print("Sorry, that wasn't correct. Please try again by entering a number: ")
store2end = int(input("Please enter the amount of money you have at the end of the day in store 2: "))
store3end = int(input("Please enter the amount of money you have at the end of the day in store 3: "))
store4end = int(input("Please enter the amount of money you have at the end of the day in store 4: "))
store5end = int(input("Please enter the amount of money you have at the end of the day in store 5: "))
moneyintheevening=['store1end','store2end','store3end','store4end','store5end']
for number in moneyintheevening:
result = store1end - store1beginning
print("The sales in store 1 are",result)
but it doesn't work out and I don't get any further how i can calculate the other 4 stores and how to ssort them.
and how can i apply the try and except to all statements?
manager of 5 stores.
determine the sales of the individual stores was from the last day.
Write a program that asks how much money was available in the 5 stores at the beginning of the day and how much money was in the cash register at the end of the day.
Calculate how much sales each store has made and which of the 5 stores has achieved the highest or lowest sales.
print the information for each store and determine the store with the largest and smallest sales.
What i did:
while True:
try:
store1beginning = int(input("Please enter the amount of money you have in the morning in store 1: "))
break
except:
print("Sorry, that wasn't correct. Please try again by entering a number: ")
store2beginning = int(input("Please enter the amount of money you have in the morning in store 2: "))
store3beginning = int(input("Please enter the amount of money you have in the morning in store 3: "))
store4beginning = int(input("Please enter the amount of money you have in the morning in store 4: "))
store5beginning = int(input("Please enter the amount of money you have in the morning in store 5: "))
moneyinthemorning=['store1beginning','store2beginning','store3beginning','store4beginning','store5beginning']
while True:
try:
store1end = int(input("Please enter the amount of money you have at the end of the day in store 1: "))
break
except:
print("Sorry, that wasn't correct. Please try again by entering a number: ")
store2end = int(input("Please enter the amount of money you have at the end of the day in store 2: "))
store3end = int(input("Please enter the amount of money you have at the end of the day in store 3: "))
store4end = int(input("Please enter the amount of money you have at the end of the day in store 4: "))
store5end = int(input("Please enter the amount of money you have at the end of the day in store 5: "))
moneyintheevening=['store1end','store2end','store3end','store4end','store5end']
for number in moneyintheevening:
result = store1end - store1beginning
print("The sales in store 1 are",result)
but it doesn't work out and I don't get any further how i can calculate the other 4 stores and how to ssort them.
and how can i apply the try and except to all statements?