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
CHALLENGE ACTIVITY 7.8.1: Enter the output of the unit tests. Note: Below, there's always a unit test failure. 378390.25
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
CHALLENGE ACTIVITY 7.8.1: Enter the output of the unit tests. Note: Below, there's always a unit test failure. 378390.25
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!