Question
You are to write a program that produces a specific text figure that is supposed to look like a rocket ship. You should exactly reproduce
You are to write a program that produces a specific text figure that is supposed to look like a rocket ship. You should exactly reproduce the format of the output described in the specification below. This includes having identical characters and spacing. Initially, your program will read in a single input from the python shell. The prompt for the value should look like so: Enter rocket size: X. The user of the program may enter any value for X greater than or equal to 2. Using this value, your program will print out a rocket with corresponding width, height, and patterns. Below is an example of what the program will print when a size of 2 is entered:
When size 3 is entered instead, notice how the rocket grows:
One way to write a Python program to draw this figure would be to write a single print statement that prints each line of the figure. However, this solution would not receive full credit. A major part of this assignment is showing that you understand while loops. In lines that have repeated patterns of characters that vary in number from line to line, represent the lines and character patterns using while loops and string multiplication.
This program is intended to test your knowledge of loops and nested loops. You may only use python constructs introduced in class. If you are wondering wether or not you are allowed to use something, just ask!
Use of functions for structure and elimination of redundancy
Continue to use functions to structure your solution in such a way that the functions match the structure of the output itself. Avoid significant redundancy; use functions so that no substantial groups of identical statements appear in your code. No print statements should appear in your main function. You do not need to use functions to capture redundancy in partial lines, such as the three groups of periods in the following line:
//111 7* IV INAW/N/ 7*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