Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started