You are using a version without Ads of this website. Please, consider donating:

Help on a project

So my class has this project and I am just not sure where I should start. Here is the project. I would just like hints on where to start. Thanks Note: The __ in the sample are suppose to spaces

 Complete the following programming project "Rocket"......which deals a great deal with "functional decomposition". This program is broken down into phases for your convenience only. Please turn in only your final product. Note: You are encouraged to use as much code from lesson#5 notes as you can for this project! DO NOT USE global variables. Phase 1: Write a program that draws a rocket shape on the screen based on user input of three values, height, width and stages. The type of box generated (ie. an outline or filled-in) is based on a check for odd or even values input by the user for the box height (or number of rows). Here is the general specification given user input for the height of the box..... Draw an outline of a box for each stage if the value for the height of the box (or number of rows) is an even number. Draw a filled-in box for each stage if the value for the height of the box (or number of rows) is an odd number. INPUT VALIDATION: Do not accept values less than 3 or greater than 15. ROCKET SAMPLE#1 WITH 2 STAGES ROCKET BODY HAS TWO EVEN HEIGHT BOX SHAPES (i.e., each with height = 6 or number of rows = 6) NOTE THAT THE BOX SHAPE HAS A CARGO BAY THAT IS EMPTY __* _*_* *___* ***** < top row *___* *___* <= box outline for stage#1 *___* *___* ***** < bottom row ***** < top row *___* *___* <= box outline for stage#2 *___* *___* ***** < bottom row __* _*_* *___* ROCKET SAMPLE#2 WITH 2 STAGES ROCKET BODY HAS TWO ODD HEIGHT BOX SHAPES (i.e., each with height = 7 or number of rows = 7) NOTE THAT THE BOX SHAPE HAS A CARGO BAY THAT IS FILLED __* _*_* *___* ***** < top row ***** ***** ***** <= box filled for stage#1 ***** ***** ***** getDimensions(); drawRocket(); } Please make sure to place a comment near each of your function definitions, use good decomposition, separate your functions with at least 1 inches of whitespace and DO NOT use global variables. I suggest that now would be a good time to reread the program style, formatting and documentation section in the syllabus and review Dale text Appendix F reference section on functions. Paste your source code from phase 3 followed by your output from phase 3. A single output is sufficient, unless you do the extra credit, in which case you should show examples of both even and odd cone widths.
It seems like the professor laid it out for you:

 Your main function in phase 1 may look like either of these: function decomposition #1 - seperate functions to generate an outline or filled in box shape functional decomposition#2 - one drawBox function but with procedures within the functions to generate both an outline and a filled in box shape int main() { //functions for sample#1 drawCone(); drawEvenBox(); drawEvenBox(); drawCone(); //functions for sample#2 drawCone(); drawOddBox(); drawOddBox(); drawCone(); } int main() { //functions for sample#1 and sample#2 drawCone(); drawBox(); //procedures within the function to generate both box shapes drawCone(); }
so here is where I get confused I think.

 int main() { //functions for sample#1 and sample#2 drawCone(); drawBox(); //procedures within the function to generate both box shapes drawCone(); }

don't I need two drawBoxes? one for filled and one without?
Ok so I got a pretty good start on my code but on line 72 I get the following error
"error: lvalue required as left operand of assignment" and I am not sure as to why. Here is my code.
 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182`` ``````#include #include using namespace std; //functions for sample#1 void drawOddCone(int width) { for(int j=1;j<=width;j+=2) { for(int i=1;i<=(width-j)/2;i++) { cout<<" "; } cout<<"*"; if(j>1) { for(int h=1; h<=j-2; h++) { cout <<" "; } cout<<"*"; } cout<>rocketHeight; cout <<"Please enter a number for the width of the rocket?\n"; cin>>rocketWidth; cout <<"Please enter a number for the stages of the rocket?\n"; cin>>rocketStage; cout<<"Would you like the rocket to be filled or open?(F/O)\n"; cin>>rocketType; // displays rocket with odd height and odd width. if((rocketHeight %2 != 0) && (rocketWidth %2 != 0) && (rocketType = 'F'|| rocketType = 'f')) { drawOddCone(rocketWidth); for (int l =1;l<=rocketStage; l++) { drawOddBoxFilled(rocketHeight,rocketWidth); } drawOddCone(rocketWidth); } } ``````
Line 72: == is the comparison operator. = is the asignment operator.
 `` `` ``(rocketType == 'F'|| rocketType == 'f')``
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250`` ``````#include #include using namespace std; //functions for sample#1 void drawOddCone(int width) { for(int j=1;j<=width;j+=2) { for(int i=1;i<=(width-j)/2;i++) { cout<<" "; } cout<<"*"; if(j>1) { for(int h=1; h<=j-2; h++) { cout <<" "; } cout<<"*"; } cout<=1) { for(int h=1; h<=2*j-2; h++) { cout <<" "; } cout<<"*"; } cout<>h; cout <<"Please enter a number for the width of the rocket?\n"; cin>>w; cout <<"Please enter a number for the stages of the rocket?\n"; cin>>s; cout<<"Would you like the rocket to be filled or open?(F/O)\n"; cin>>t; } int main() { char again; int rocketHeight; int rocketWidth; int rocketStage; char rocketType; do { getDiminsions(rocketHeight,rocketWidth,rocketStage,rocketType); if((rocketHeight>3 && rocketHeight<15) && (rocketWidth>3 && rocketWidth<15)) { // displays rocket with odd height and odd width and filled. if((rocketHeight %2 != 0) && (rocketWidth %2 != 0) && (rocketType == 'F'|| rocketType == 'f')) { drawOddCone(rocketWidth); for (int l =1;l<=rocketStage; l++) { drawOddBoxFilled(rocketHeight,rocketWidth); } drawOddCone(rocketWidth); } // displays rocket with odd height and odd width and open. if((rocketHeight %2 != 0) && (rocketWidth %2 != 0) && (rocketType == 'O'|| rocketType == 'o')) { drawOddCone(rocketWidth); for (int l =1;l<=rocketStage; l++) { drawOddBoxOpen(rocketHeight,rocketWidth); } drawOddCone(rocketWidth); } //displays rocket with even height and even width and filled. if((rocketHeight %2 == 0) && (rocketWidth %2 == 0) && (rocketType == 'F'|| rocketType == 'f')) { drawConeEven(rocketWidth); for (int q =1;q<=rocketStage;q++) { drawEvenBoxFilled(rocketHeight,rocketWidth); } drawConeEven(rocketWidth); } //displays rocket with even height and even width and open. if((rocketHeight %2 == 0) && (rocketWidth %2 == 0) && (rocketType == 'O'|| rocketType == 'o')) { drawConeEven(rocketWidth); for (int q =1;q<=rocketStage;q++) { drawEvenBoxOpen(rocketHeight,rocketWidth); } drawConeEven(rocketWidth); } // displays rocket with even height and odd width and filled. if((rocketHeight %2 == 0) && (rocketWidth %2 != 0) && (rocketType == 'F'|| rocketType == 'f')) { drawOddCone(rocketWidth); for (int l =1;l<=rocketStage; l++) { drawEvenBoxFilled(rocketHeight,rocketWidth); } drawOddCone(rocketWidth); } // displays rocket with even height and odd width and open. if((rocketHeight %2 == 0) && (rocketWidth %2 != 0) && (rocketType == 'O'|| rocketType == 'o')) { drawOddCone(rocketWidth); for (int l =1;l<=rocketStage; l++) { drawEvenBoxFilled(rocketHeight,rocketWidth); } drawOddCone(rocketWidth); } // displays rocket with odd height and odd width and filled. if((rocketHeight %2 != 0) && (rocketWidth %2 == 0) && (rocketType == 'F'|| rocketType == 'f')) { drawConeEven(rocketWidth); for (int l =1;l<=rocketStage; l++) { drawOddBoxFilled(rocketHeight,rocketWidth); } drawConeEven(rocketWidth); } // displays rocket with odd height and odd width and open. if((rocketHeight %2 != 0) && (rocketWidth %2 == 0) && (rocketType == 'O'|| rocketType == 'o')) { drawConeEven(rocketWidth); for (int l =1;l<=rocketStage; l++) { drawOddBoxFilled(rocketHeight,rocketWidth); } drawConeEven(rocketWidth); } } else { cout <<"Invalid Input. Please try again or quit.\n"; } cout<<"Would you like to do this again?(y/n)"<>again; }while(again == 'Y' || again =='y'); return 0; } ``````