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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post 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 84 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply