Page 1 of 1

CHALLENGE ACTIVITY 7.8.1: Enter the output of the unit tests. Note: Below, there's always a unit test failure. 378390.25

Posted: Sun May 15, 2022 1:04 pm
by answerhappygod
Challenge Activity 7 8 1 Enter The Output Of The Unit Tests Note Below There S Always A Unit Test Failure 378390 25 1
Challenge Activity 7 8 1 Enter The Output Of The Unit Tests Note Below There S Always A Unit Test Failure 378390 25 1 (39.73 KiB) Viewed 85 times
CHALLENGE ACTIVITY 7.8.1: Enter the output of the unit tests. Note: Below, there's always a unit test failure. 378390.2577248.qx3zqy7 Jump to level 1 Type the program's output Call Rectangle.java Rectangle.java public class Call Rectangle { public static void main(String[] args) { Rectangle myRectangle = new Rectangle(); myRectangle.setSize(1, 1); if (myRectangle.getArea() != 1) { System.out.println("FAILED getArea() for 1, 1"); } if (myRectangle.getPerimeter() != 4) { System.out.println("FAILED getPerimeter() for 1, 1"); } myRectangle.setSize (2, 3); if (myRectangle.getArea() != 6) { System.out.println("FAILED getArea() for 2, 3"); } if (myRectangle.getPerimeter() != 10) { System.out.println("FAILED getPerimeter() for 2, 3"); } } } 1 2 3 Check Next

378390.2577248.qx3zqy7 Jump to level 1 Type the program's output CallRectangle.java Rectangle.java public class Rectangle { private int height; private int width; public void setSize(int heightVal, int widthval) { height = heightVal; width = widthval; } public int getArea() { return width * width; } public int getPerimeter() { return (height 2) + (width * 2); } 1 Check Next