Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

More ascii art! Having exhausted the 2D primitive shapes, you'll take it to the next dimension with this excercise. Write a program called print_cube.py that

image text in transcribedimage text in transcribed

More ascii art! Having exhausted the 2D primitive shapes, you'll take it to the next dimension with this excercise. Write a program called print_cube.py that prompts the user for a numerical value that is a multiple of 2 and prints out a cube as shown below. In the case of 4: $ python print_cube.py Input cube size (multiple of 2): 4 I 1 1 L/ 1 1/ In the case of 2: $ python print_cube.py Input cube size (multiple of 2): 2 +----+ / 1 +----+ 1 1 | + 14 In the case of 10: $ python print_cube.py Input cube size (multiple of 2): 10 / | 1 Drawing the cube You'll draw the cube using the following characters: + for cube corners, - for horizontal lines, for vertical lines, and for diagonals. Specifically, for a cube of size n, draw the cube as follows: A horizontal edge is drawn with and requires 2n characters. A vertical edge is drawn with and requires n characters. A vertical edge is drawn with and requires n/2 characters. Corners are drawn with + . Corners should line up with vertical and horizontal edges. Use at least one function defined in addition to main(). From now on, try to think about minimizing the amount of functionality you leave to main() . Ideally, main() should only be a few lines of code

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

What must a creditor do to become a secured party?

Answered: 1 week ago

Question

When should the last word in a title be capitalized?

Answered: 1 week ago