Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to write in python language? The Program Overview The program will be given 3 extra command line arguments. python3 shopkeeper py is the cheapest

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
How to write in python language?
The Program Overview The program will be given 3 extra command line arguments. python3 shopkeeper py is the cheapest price we can sell the item for.Any time the item is dicounted, it should not go below this price. is how many of that item we want to start off with. You may assume that all command line arguments will be strictly positive numbers, and that stoek> will be a whole number. You may also assume that cninimum price> will be less than or equal to itente) sold where eday mumber> is the number of days which have passed, and Current price: $price> Current sales: $csales> Stock 1efti item(s) sold yesterday item(s) sold so far today All values which represent money should be displayed to exactly 2 decimal places. Note: csales> is the total amount of money made across all days so far bye Quits. Tells the user how much money they ended up making in the following format, and quits. You made $ in sales! (where info Day 2 Current prices $5.00 Current sales $25.00 Stock 1efti 15 2 item(s) sold yesterday 3 item(s) sold so far today bye You made $25.00 in sales Invalid Command s python3 shopkeeper py 20 103 > hello Invalid command sell Sold 1 item bye You made $20.00 in sales! Reducing the Price $ python3 shopkeeper py 15 10 S > sell Sold 1 ites sell Sold 1 iten next Surmary of day l 2 item(s) sold next Summary of day 2: 0 iten(s) sold >info Day 3 Current price: $14.90 Current sales: $30.00 Stock left: 3 0 item(s) sold yesterday o item(s) sold so far today sell Sold 1 item bye You nade $44.90 in sales! Reaching the Minimum Price $ python3 shopkeeper.py 15.20 15 20 sell Sold 1 item sell Sold 1 item sell Sold 1 item sell Sold 1 item next Surmary of day l: 4 item(s) sold sell Sold 1 item sell Sold 1 item > sell Sold 1 item > next Summary of day 2: 3 item(s) sold sell Sold 1 item sell Sold 1 item next Sumnary of day 3: 2 item(s) sold > info Day 4 Current prices $15.00 Current sales1 $136.60 Stock left: 11 2 item(s) sold yesterday 0 iten(s) sold so tar today next Summary of day 4: 0 item(s) sold > info Day 5 Current price: $15.00 Current sales: $136.60 Stock left: 11 0 item(s) sold yesterday 0 item(s) sold so far today bye You made $136.60 in sales! Running out of stock s python3 shopkeeper py 10.50 1.0 2 > sell Sold 1 item sell Sold 1 item No more stockl You made $21.00 in sales Extra Information and Hints . Any time the program displays a message to the user, it should be followed by an empty line You may find the maxa function helpful, although it is not necessary Commands are case-sensitive. For example, se11 is valid, but SELL is invalid The first day when the program starts is considered day 1

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

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions

Question

Find the covariance and correlation between a bX and c dY .

Answered: 1 week ago

Question

What is operating capital, and why is it important?

Answered: 1 week ago