Printing Shapes
Create a program that:
- Prompt the user to choose between a rectangle and a triangle
- Prompt user for shape parameters
- Rectangle
- Ask user to choose between supplying a word or a width
- Ask user for height
- Triangle
- Ask user to choose between supplying a word or a width
- Ask whether the triangle points up or down
- Print the desired shape
- Ask the user whether they want to print to a file, βmyshape.txtβ, or to cout
- This can be accomplished using fewer lines of code by using the base ostream type as an argument, which ofstream and cout are both derived from. See here
- Ask the user if they would like to exit, or return to step 1
- Ask the user whether they want to print to a file, βmyshape.txtβ, or to cout
- Rectangle
You must use at least two functions in this lab. How involved you get with them (including arguments, creating helper functions) is left up to you.
Points:
2 β Documentation, readability, format
2 β Proper program flow (conditionals, loops, etc)
1 β File output
- β Functions
- β Filename and Header2 β Output testing
Β




