Question: . In a single Java program, write the following patterns using nested loops, The user should be able to indicate the line height of the

. In a single Java program, write the following patterns using nested loops, The user should

be able to indicate the line height of the pattern, and choose one pattern in every execution.

After printing one pattern the user should be able to print another pattern

Choice 1: Right Triangle

Choice 2: Inverted right triangle

Choice 3: Pascal Triangle

Choice 4: Random Triangle

Application

Sample Output

Enter line height:5

Select Pattern:

A: right triangle

B. Inverted right triangle

C: Pascal Triangle

D. Random Triangle

Choice: A

Another entry [Yes/No]:Yes

Enter line height:5

Select Pattern:

A: right triangle

B. Inverted right triangle

C: Pascal Triangle

D. Random Triangle

Choice: B

Another entry [Yes/No]:NO

Invalid Input

Another Entry [Yes/No]: No

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 Programming Questions!