Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Bernard as to manage the stocks of a window warehouse, week by week. The stock for week 1 is 1024 windows. In addition, it

Python

Bernard as 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 is dedicated to the design of a program helping Bernard in her inventory management and according to the specifications described below.

The program should start by displaying the following menu:

a. Stock forecasts

b. Maximum stock

(q to leave)

If Bernard types q, the program stops.

If Bernard taps a, the program asks her for a week n issue and then displays the stock forecast from week 1 to week n. Like what:

Choose a week: 6

Week 1 : stock 1024

Week 2 : stock 1002

Week 3 : stock 979

Week 4 : stock 1455

Week 5 : stock 1430

Week 6 : stock 1404

If Bernard 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). Like what:

Choose a week: 6

Max stock equal to 1455 , reached in week 4

If Bernard types something other than a, b, or q, the program displays an Incorrect Choice error message to her, try again, and start displaying this message again until the choice is valid.

Example 1

a. Stock forecasts

b. Maximum stock

(q to leave)

a

Choose a week: 7

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

a. Stock forecasts

b. Maximum stock

(q to leave)

b

Choose a week: 8

Max stock equal to 1849 , reached in week 8

a. Stock forecasts

b. Maximum stock

(q to leave)

q

Example 2

a. Stock forecasts

b. Maximum stock

(q to leave)

c

Incorrect choice, repeat 1

Incorrect choice, repeat b

Choose a week: 10

Max stock equal to 1849 , reached in week 8

a. Stock forecasts

b. Maximum stock

(q to leave)

q

Example 3

a. Stock forecasts

b. Maximum stock

(q to leave)

p

Incorrect choice, repeat

Example 4

a. Stock forecasts

b. Maximum stock

(q to leave)

a

Choose a week: 3

Week 1 : stock 1024

Week 2 : stock 1002

Week 3 : stock 979

a. Stock forecasts

b. Maximum stock

(q to leave)

a

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

a. Stock forecasts

b. Maximum stock

(q to leave)

q

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions