Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Case You have been tasked to create a program that draws a box. Your program needs to ask the user for the dimensions of the

Case

You have been tasked to create a program that draws a box. Your program needs to ask the user for the dimensions of the box or length and width. The program will then print out your box.

Since the dimensions of the box will vary each time you run the program, here is a sample output when the user entered 5 for the box width and 10 for the box length.

********** * * * * * * ********** 

Part 2 Instructions

In Zybooks, write the code that creates the box. Since the inputs will vary, you will need to use a loop to create the box. To start, remove the two print statements that tested your inputs. To create a little space between your input statements and the box, add an empty print (or print()) statement underneath your input statements. This will produce the following when 5 is entered for the width and 10 for the length.

Enter the width of your box: 10 Enter the length of your box: 5 ********** * * * * * * ********** 

Some Help: To get a border that varies with the width input, you could write:

border = "*" * width print(border) 

If the user enters 10 for the width, the following will print:

********** 

Additionally don't forget, you can use string concatenation to fill in the middle of the box. For instance:

border = "*" + " " + "*" print(border) 

This will print:

* * 

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 Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

What are the inputs to master scheduling? What are the outputs?

Answered: 1 week ago

Question

A 300N F 30% d 2 m Answered: 1 week ago

Answered: 1 week ago