Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program is broken down into phases for your convenience only. Please turn in only your final product. Phase 1: Write a program that draws

This program is broken down into phases for your convenience only. Please turn in only your final product.

Phase 1: Write a program that draws a rocket on the screen. Here's what the rocket should look like:

 X X X X X XXXXX X X X X X X X X XXXXX XXXXX X X X X X X X X XXXXX X X X X X 

Your main function in phase 1 must look like this:

 int main() { drawCone(); drawBox(); drawBox(); drawCone(); } 

You may use three cout statements (no loops are necessary) in your drawCone() function. For your drawBox() function, you must use the drawHorizontalLine(), draw2VerticalLines(), and drawOneRow() functions exactly as they appear in lesson 6. For phase 1 you'll be using the versions from lesson 6.3. (Note: since you'll be using these four functions directly from the lesson, you are not required to document them.)

Phase 2: In this phase you will allow the user to specify three things:

the height of each stage

the width of each stage

how many stages in the rocket

[A "stage" in your rocket is one rectangle. The example rocket above has a stage-height of 6, a stage-width of 5, and the number of stages is 2.]

Your main method in phase 2 must look like this:

 int main() { <6 statements to prompt for and read the stage-height, stage-width, number of stages.> drawRocket(); } 

You must still use the drawHorizontalLine(), draw2VerticalLines(), drawOneRow(), drawBox() functions exactly as they appear in lesson 6. For phase 2 you'll be using the versions from lesson 6.6.

Notice that if you run the program and choose a different width for your stages, the cone won't really fit correctly anymore. I won't make you fix this (in other words, you can keep your three line drawCone() function from phase 1) but you can fix it for 5 points of extra credit if you like. However, I will not help you with the extra credit. In order to get the extra credit, the number of rows of your cone must be equal to the width of the stages divided by 2 (plus 1 for odd widths). If the stage width is an even number, your cone must have two stars in the top row instead of one. If you do this perfectly and use good decomposition in the process you'll get 5 extra credit points.

Phase 3: In this phase you won't change what the program produces. We're just going to improve on the organization a bit. Change your program so that the main function looks like this:

 int main() {  getDimensions(); drawRocket(); } 

You must still use the drawBox(), drawHorizontalLine(), draw2VerticalLines(), and drawOneRow() functions exactly as they appear in lesson 6. They should remain unchanged from phase 2.

When you submit your work, a single run of the program will suffice, unless you do the extra credit, in which case you should show examples of both even and odd cone widths. Also, don't worry if your rocket no longer looks right after you paste it into your file. This won't affect your grade.

As described in the Style Conventions, please make sure to place a detailed comment above each of your function definitions, use good decomposition, and separate your functions with at least 6 blank lines. I suggest that now would be a good time to reread the Style Conventions section of the Syllabus.

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

i need 5 2 7 .

Answered: 1 week ago