Question: Write a program that gets an integer, n, from the user and then prints n repetitions of the pattern: some Bs, some As. Each new

Write a program that gets an integer, n, from the user and then prints n repetitions of the pattern: some Bs, some As. Each new repetition has two less Bs and two more As than the pattern before it. The first pattern has 2*n+1 Bs and 1 A. Example: if the number from the user is n=3, then the program prints: BBBBBBBABBBBBAAABBBAAAAABAAAAAAA

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!