Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON PROGRAMMING ONLY PLEASE 1. This application will ask the number of shirts for each size that you have. The user will enter one number,

PYTHON PROGRAMMING ONLY PLEASE

1. This application will ask the number of shirts for each size that you have. The user will enter one number, so if they enter 6, that means you start with 6 small, 6 medium, and size large shirts. The number entered must be an integer number. If it is not an integer number, print an error message and exit the program.

2. Start a loop and to ask each person how many shirts that they want and the size (S, M, or L). A person must enter a positive integer number. If the entry is not valid, print an error message and just ask for the number again. If the size is not correct, keep asking until you get a valid size.

3. Keep track of and print out the number of shorts remaining.

4. If you dont have enough shirts in that size, print a message that says Not enough shirts!

5. Keep going until you run out of all shirts and the program can stop.

image text in transcribed

image text in transcribed

Sample Execution (User Inputs are in Bold Italics): Please enter the number of shirts available: 10 Please enter the number of shirts:-1 Invalid Number! Please enter the number of shirts: 4 Please enter the size: Q Shirts can only be S, M, or L Please enter the size: L We have (6) L, (10) M, and (10) S shirts left. Please enter the number of shirts: 8 Please enter the size: L Not enough shirts! We have (6) L, (10) M, and (10) S shirts left. Please enter the number of shirts: c Invalid Number! Please enter the number of shirts: 6 Please enter the size: L We have (0) L, (10) M, and (10) S shirts left. Please enter the number of shirts: 10 Please enter the size: M We have (0) L, (0) M, and (10) S shirts left. Please enter the number of shirts: 10 Please enter the size: S We have (0) L, (10) M, and (0) S shirts left. Please enter the size: L We have (0) L, (10) M, and (10) S shirts left. Please enter the number of shirts: 10 Please enter the size: M We have (0) L, (0) M, and (10) S shirts left. Please enter the number of shirts: 10 Please enter the size: S We have (0) L, (10) M, and (0) S shirts left

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

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

7. Define cultural space.

Answered: 1 week ago

Question

8. Describe how cultural spaces are formed.

Answered: 1 week ago