Question: Solve in JAVA. 9.3: Pyramid Thanks to advances in modern technology. you can build the pyramids from the comfort of your own computer. In this


Solve in JAVA.
9.3: Pyramid Thanks to advances in modern technology. you can build the pyramids from the comfort of your own computer. In this problem, you will write a program that asks the user to input the height of a pyramid. Then, you will print out a text representation of that pyramid. In your ouput, use square brackets [1 to represent one block of the pyramid, and use two space characters to represent a place where there is air instead of a block. If the user gives a height that is not a positive integer, keep asking until they enter a valid one. Your solution m ust use for loops to print out the pyramid. Tips Think through these questions before you start How many lines of output will there be? How many pyramid blocks [] should be printed on each row? How many air blocks [two space characters] should be printed before the pyramid blocks on each row? Where should the nested loops be used? What does the outer loop reperesent? Make sure the air blocks are symmetrical on both sides of the pyramid structure on each row. All the newline characters should be aligned in a single column in the pyramid output. Try using multiple inner loops for each row, one to print the air on the left side, one to print the pyramid blocks and one to print the air on the right side
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
