Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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; cout