Question: 8 . 8 Project 8 . 1 Complete Project 8 . 1 . This program is broken down into phases for your convenience only. Please

8.8 Project 8.1
Complete Project 8.1.
This program is broken down into phases for your convenience only. Please turn in only your final product.
Important Notes:
1. Do not use classes, arrays, vector, structs, global variable, value-returning function and any advance features that have not been covered in this course.
2. Function declaration/prototype is required.
3. Function documentation is required. Refer to Programming with Style, Initial File Comments and Inline Comments, Documentation Sample and Style Conventions for details.
4. Make sure your file name is main.cpp
If you don't follow the important notes above, it may result in a grade of 0.
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.
Phase 2: In this phase you will allow the user to specify three things:
the width of each stage
the height 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, and number of stages.> drawRocket(); }
In order to make this work with the zyBooks unit tester, we'll need to agree on an order for the arguments. Here's the rule: the width of the rocket, if it is an argument, must always be first. The number of stages in the rocket, if it is an argument, must always be last.
You must use the drawHorizontalLine(), draw2VerticalLines(), drawOneRow(), drawBox() functions exactly as they appear in lesson 6.7.
Notice that if you run the program and choose a different width for your stages, the cone won't 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.
Note on zyBooks and the extra credit: You only need to read this if your extra credit rocket seems correct outside of zyBooks but is marked incorrect by zyBooks. zyBooks is set up to mark the output as incorrect if there are spaces to the right of the final X on any line. If your solution works correctly, but prints spaces to the right of the final X on a line, you'll need to email me so I can adjust your score manually.
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.7. They should remain unchanged from phase 2.(Note: since you'll be using these four functions directly from the lesson, you are not required to document them.)
As described in the Style Conventions and Documentation Sample, 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. Note that you are not required to provide documentation for functions that you copied from the lesson.
579674.4408032.qx3zqy7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!