Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

When size 3 is entered instead, notice how the rocket grows:

image text in transcribed

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

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

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago