JAVA PROGRAMMING Below is a completed code the prints stairs with stick figures on each step. Rewrite this code by removing the "man" methods and incorporating the stick figure into one of the other...


JAVA PROGRAMMING


Below is a completed code the prints stairs with stick figures on each step. Rewrite this code by removing the "man" methods and incorporating the stick figure into one of the other methods. Do not remove the COUNT value, or do anything that will change the output of the program. Simply remove the man method and make one of the other methods draw the stick figure on each step.


CODE


public class ProgrammingAssignment1 {


    public static int COUNT = 5;


    public static void main(String[] args) {


        man2();


    }


    public static void man() {


        System.out.println(" 0      ******");


        System.out.println("/|\\       *");


        System.out.println("/ \\       *");


    }


    public static void print_tabs(int n) {


        for (int i = n - 1; i >= 0; i--)


            System.out.print("\t");


    }


    // prints end of stairway on extra long first line


    public static void print_first_closer(int n) {


        // n + 1 because base of stairs


        print_closer(n + 1);


    }


    // prints end of stairway on normal line


    public static void print_closer(int n) {


        //


        for (int i = COUNT - n; i >= 0; i--)


            System.out.print("    ");


        System.out.println("*");


    }


    // prints a man on a staircase


    public static void man2() {


        for (int i = COUNT; i > 0; --i) {


            print_tabs(i);


            System.out.print(" 0   *****");


            print_first_closer(i);


            print_tabs(i);


            System.out.print("/|\\ *");


            print_closer(i);


            print_tabs(i);


            System.out.print("/ \\ *");


            print_closer(i);


        }


    }


}


OUTPUT (DO NOT CHANGE)


                                0 *******


                               /|\ *     *


                               / \ *     *


                           0 ******     *


                          /|\ *          *


                          / \ *          *


                      0 ******          *


                     /|\ *               *


                     / \ *               *


                 0 ******               *


                /|\ *                    *


                / \ *                    *


            0 ******                    *


           /|\ *                         *


           / \ *                         *


       0 ******                         *


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here