creating a program in C++ visual studios
creating a program in C++ visual studios
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, and whether the triangle points up or down
- Read input
- Rectangle
- Print the desired shape
- Ask the user whether they want to print to a file, “myshape.txt”, or to cout
- Ask the user if they would like to exit, or return to step 1
Points:
2 – Documentation, readability, format
2 – Proper program flow (conditionals, loops, etc)
1 – File output
1 – Functions
2 – Filename and Header
2 – Output testing
Header
//<Your Name>
//CPSC 121 Lab 3
//<MM/DD/YY>
Filename
<Last Name><First Initial>lab3.cpp
For example, my assignment would be named MayElab3.cpp
Functions provided as reference; you do NOT need to use functions in this program, although it is allowed.
//void DrawRectangle(int width, int height);
//DrawRectangle(5,3)
*****
*****
*****
//void DrawRectangle(string word, int height);
//DrawRectangle(“VOTE”, 3)
shape.txt:
VOTE
VOTE
VOTE
//void DrawTriangle(int size, bool pointingUp);
//DrawTriangle(4, true)
*
**
***
****
//void DrawTriangle(string word, bool pointingUp);
//DrawTriangle(“VOTE”, false)
VOTE
OTE
TE
E
//DrawTriangle(“VOTE”, true)
E
TE
OTE
VOTE
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


