Question: Have a program request the user to enter an uppercase letter. Use nested loops to produce a pyramid pattern like this: A ABA ABCBA ABCDCBA

Have a program request the user to enter an uppercase letter. Use nested loops to produce a pyramid pattern like this:

A

ABA

ABCBA

ABCDCBA

ABCDEDCBA

The pattern should extend to the character entered. For example, the preceding pattern would result from an input value of E. Hint: Use an outer loop to handle the rows. Use three inner loops in a row, once to handle the spaces, one for printing letters in ascending order, and one for printing letters in descending order. If your system doesnt use ASCII or a similar system that represents letters in strict number order, see the suggestion in programming exercise 3.

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!