Question: PROGRAM DESCRIPTION: In this assignment, you will write a single Python script called minor 4 . py that prints a rectangle with the height and

PROGRAM DESCRIPTION:
In this assignment, you will write a single Python script called
minor4.py that prints a
rectangle with the height and width dimensions given from two parameters input from
the user. In particular, you are to implement the following:
Define a function that accepts two parameters, width and height, which draws the
rectangle according to the user's requested dimensions. You are to draw the
appropriate sized rectangle with the '+' character on all four corners, the '-'
character at the top and bottom rows between the '+' characters at the comers,
and the '|' character at the first and last columns between the '+' characters at the
corners, with spaces in between.
In the main part of the Python script you are to:
Prompt for and read in the width of the rectangle. If the user enters a value
less than 2, you are to print an error message and exit the script.
If the user entered an acceptable value for the width, then you are to
prompt for and read in the height of the rectangle. If the user enters a
value less than 2, you are to print an error message and exit the script.
If the user entered an acceptable value for the height, then you are to call
your function to draw the rectangle, passing in the width and height
parameters.
You may assume that the user enters integers for the width and height, though
one or both may be out of range.
SAMPLE OUTPUT (user input shown in bold):
PROGRAM DESCRIPTION: In this assignment, you will

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!