Part 1: Write a C++ program that gets two inputs an integer and a character. Use
ID: 3647110 • Letter: P
Question
Part 1:Write a C++ program that gets two inputs an integer and a character. Use repetition control structures better known as "loops" to output a triangle shape composed of the character and the width specified by the integer. If the input is an even number, it should be increased to the next odd number. Use meaningful variable names, nested loop statements with proper indentation, appropriate comments, and good prompting messages.
For example, if the integer is 11 and the character is an asterisk (*), the triangle shape would look like this:
Sample screen output 1:
Enter a value to represent the base of a triangle shape (not to exceed 80): 11
Enter the character to be used to generate the triangle shape (for eg., #, * $): *
*
***
*****
*******
*********
***********
Explanation / Answer
// Assignment 4.2 //Triangle #include using namespace std; int main() { const int NUM_ROWS = 6; const int MAX_symbols = 80; int baseNum; int numSpaces; int numsymbols; char symbol; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.