Java

TOPIC 31 – MODULAR PROGRAMMING

 

LESSON WORK

 

 

INDIVIDUAL WORK

 

QUESTION (CONTINUED)

 

You will continue to work with BC.java and BCTester.java. 

 

In each of the following parts, you will

a)    Create the specified function inside BC.java.

b)    Test that function from the main function inside BCTester.java.

 

PART 1

 

public static void outputRectangleOutline(int rows, int cols)

                      

 

PART 2

 

public static void outputSquareOutline(int size)


                      

PART 3

 

public static void outputTriangle(int rows)


                      

PART 4

 

public static void outputTriangleReverse(int rows)

 

                      

 

PART 5

 

public static void outputPyramid(int rows)

                      

 

PART 6

 

public static void outputDiamond(int rows)

 

Note: The amount of rows has to be odd.  Otherwise, any appropriate error message should be displayed.

                      

 

PART 7

 

public static void outputPyramidOutline(int rows)


                      

PART 8

 

public static void outputDiamondOutline(int rows)

 

                      

 

PART 9

 

public static void outputHuman(int hw, int hh, int nl, int al, int ll, int fl)


where hw is head width (must be odd), hh is head height, nl is neck length, al is arm length, ll is leg length and fl is foot length.

 

                      

 

Note: Human arms and feet never stick out past the head.

 

PART 10

public static void outputMartian(int hw, int hh, int nl, int al, int ll, int fl, int ant)

 

where the first six parameters are the same as for human and the last parameter, ant, stands for the antenna length.