Please answer it in Python Anna has to manage the stocks of a window warehouse, week by week. The stock for week 1 is 1024 windows. In addition, it managed to obtain the following forecasts: during week n, the number of windows that leave the warehouse (towards the stores) is 20+n. In addition, if the week number is a multiple of 4, then the warehouse receives a delivery of 500 windows from the production plant. So week 1 stock is 1024, week 2 stock is 1024-(20+2)=1002, week 3 stock is 1002-(20+3)=979, week 4 stock is 979-(20+4)+500=1455, etc. This exercise is dedicated to the design of a program helping Anna in her inventory management and according to the specifications described below. The program should start by displaying the following menu: English translation. Stock forecasts b. Stock maximal (q to leave) If Anna types q, the program stops. If Anna taps a, the program asks her for a week n issue and then displays the stock forecast from week 1 to week n. For example: Choose a week: 10 Week 1 : stock 1024 Week 2 : stock 1002 Week 3 : stock 979 Week 4 : stock 1455 Week 5 : stock 1430 Week 6 : stock 1404 Week 7 : stock 1377 Week 8 : stock 1849 Week 9 : stock 1820 Week 10 : stock 1790 If Anna types b, the program asks her for a week number n and then calculates what the maximum stock will be between week 1 and week n (and tells her in which week this maximum stock will be reached). For example: b Choose a week: 8 Max stock equal to 1849 , reached in week 8
Please answer it in Python
Anna has to manage the stocks of a window warehouse, week by week. The stock for week 1 is 1024 windows. In addition, it managed to obtain the following forecasts: during week n, the number of windows that leave the warehouse (towards the stores) is 20+n. In addition, if the week number is a multiple of 4, then the warehouse receives a delivery of 500 windows from the production plant. So week 1 stock is 1024, week 2 stock is 1024-(20+2)=1002, week 3 stock is 1002-(20+3)=979, week 4 stock is 979-(20+4)+500=1455, etc.
This exercise is dedicated to the design of a
The program should start by displaying the following menu:
- English translation. Stock forecasts
b. Stock maximal
(q to leave)
If Anna types q, the program stops.
If Anna taps a, the program asks her for a week n issue and then displays the stock forecast from week 1 to week n. For example:
Choose a week: 10
Week 1 : stock 1024
Week 2 : stock 1002
Week 3 : stock 979
Week 4 : stock 1455
Week 5 : stock 1430
Week 6 : stock 1404
Week 7 : stock 1377
Week 8 : stock 1849
Week 9 : stock 1820
Week 10 : stock 1790
If Anna types b, the program asks her for a week number n and then calculates what the maximum stock will be between week 1 and week n (and tells her in which week this maximum stock will be reached). For example:
b
Choose a week: 8
Max stock equal to 1849 , reached in week 8
Step by step
Solved in 3 steps with 2 images