Question: Write a console C# program to do the following: 1. Ask user max number of characters. This should be an odd number if user enters

Write a console C# program to do the following:

1. Ask user max number of characters. This should be an odd number if user enters even number add 1 to it to convert it to odd number.

2. Ask user the character to print

3. Your program should then output two inverted vertical triangles of base equal to number entered in #1 and made of characters in #2

4. Number of characters in one line of the triangle should differ by 2 from its next line such that the top of the triangle has only 1 character.

5. The top of the triangle (single character) should be centralized appropriately Make sure your code follows these guidelines The output string should be returned as a single string variable from a class Class should have a public function that will returns the string and takes the input for #1 and #2 as argument Code should be well commented and indented Check for all invalid input values (e.g. for #1 no character should be accepted). Suitable message should be displayed to user for incorrect input All 5 requirements should be met Code should compile and run without any error or warnings

Example: If user enters 9 for #1 and enters the character * for #2 the program should print the following:

 * *** ***** ******* ********* ********* ******* ***** *** *

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!