Starting from:
$30

$24

Homework # 8Solution

Write a program that outputs the following shapes in user-specified sizes:
***** *     *****    * ***** ***** *     *****    * *****
***** **    ****    **  **** *   * **    *  *    **  *  *
***** ***   ***    ***   *** *   * * *   * *    * *   * *
***** ****  **    ****    ** *   * *  *  **    *  *    **
***** ***** *    *****     * ***** ***** *    *****     *
    *         *    ********* *********    *    * *    *
   ***       * *    *******   *     *    **   ** **   **
  *****     *   *    *****     *   *    ***  * * ***  * *
 *******   *     *    ***       * *    **** *  * **** *  *
********* *********    *         *      ***  * * ***  * *
                                         **   ** **   **
                                          *    * *    *
Your program should allow the user to select a shape, size, and whether the shape should be solid or hollow. All incorrect input should result in an error message and re-attempt of the input. After printing a shape, the user should be given the option of printing another shape.
Your program should be divided into main.cpp, tools.cpp, and one more .cpp for your program-specific functions. All .cpp files except main should have matching .h files.
I recommend strongly the following:
    • Work first on the “top” of the structure chart: the functions that allow the user to select the shape options. After determining what the user wants, the appropriate shape-printing function (one for each shape) should be called, passing in whatever options are needed to specify details of the shape. The individual shape-printing functions should be stubs until you get the selection interface working. Then work on filling in the shape stubs, one at a time.
    • Work on the shapes in the order presented above and get each one working before proceeding to the next. This gives you a logical progression of concepts to solve.
Remember: Boxes in the structure chart are now function names, and we don’t need outline numbers any more. Try to have each function handle one conceptual idea only. If you are producing (calculating, inputting, etc.) a value that you put into a variable, consider using a function to produce the value. You should use my “tool” functions where they can be used, and develop similar functions if you need a variation on inputting. Structure charts do not include tools (system or mine).
If you want an extra challenge, try adding a circle (solid and/or hollow). In this case, the size should be the circle’s diameter.
The executable program Gold08.exe demonstrates what your program should do, except that it also does circles, which you don’t have to.
You should turn in (in a pocket folder): this assignment/grading sheet, a statement of completeness, a structure chart, and a full printout of your program.  All items should be labeled appropriately.  You should also place a “soft” (electronic) copy of all .cpp and .h files in a folder in your private FTP folder.
 

More products