Write A save Application to output the drawing on the right

Write A save Application to output the drawing on the right. Use a causes constant steps to make the program capable of printing any number of steps include a program Also use in line comment. Do Not use parameter passing redundancy is acceptable Do not use Any Features that are not entry level this code is for beginning\'s.

Solution

Please find the code to generate the output below: //code starts here public class Stairs { public static final int LENGTH=5; public static void main(String[] args) { printStairs(); } public static void printStairs() { for (int stair = 1; stair <= LENGTH; stair++) { for (int i = 0; i < 8*(LENGTH-stair); i++) { System.out.print(\" \"); } System.out.println(\" o ******\"); for (int i = 0; i < 8*(LENGTH-stair); i++) { System.out.print(\" \"); } System.out.print(\" /|\\\\ * \"); for (int i = 1; i < 8*(stair-1); i++) { System.out.print(\" \"); } System.out.println(\"*\"); for (int i = 0; i < 8*(LENGTH-stair); i++) { System.out.print(\" \"); } System.out.print(\" / \\\\ * \"); for (int i = 1; i < 8*(stair-1); i++) { System.out.print(\" \"); } System.out.println(\"*\"); } for (int i = 0; i < LENGTH*8 ; i++) { System.out.print(\"*\"); } } } //code ends here
 Write A save Application to output the drawing on the right. Use a causes constant steps to make the program capable of printing any number of steps include a

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site