Question: JAVA CODE: Write a program that prompts the user to enter an integer from 1 to 15 and displays a triangle, as presented in the
JAVA CODE: Write a program that prompts the user to enter an integer from 1 to 15 and displays a triangle, as presented in the following sample run (inverted triangle).

I have the code, kind of, but the triangle is right-side up, and also, when double digits are used the spacing isn't lining up correctly. Below is the code I have and a same for integer 15.


PE 5-3 Display Triangle Write a program that prompts the user to enter an integer from to and displays a triangle, as presented in the following sample run: 766555444433333222222111111222222333334444555667 BlueJ: Terminal Window - Chapter_05 Options Enter an integer from 1 to 15:15 1 212 32123 4321234 543212345 65432123456 7654321234567 876543212345678 98765432123456789 109876543212345678910 1110987654321234567891011 12111098765432123456789101112 131211109876543212345678910111213 1413121110987654321234567891011121314 151413121110987654321234567891011121314 Can only enter input while your program is running
Step by Step Solution
There are 3 Steps involved in it
To create an inverted triangle where the numbers align correctly even with ... View full answer
Get step-by-step solutions from verified subject matter experts
