We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Test 6 is testing for the upper bound of < 100. If you look in the constraints you will see that the number entered must be greater than -100 and less than 100. The test is failing because it tests a height of 100. The crazy thing that is missing is they do not tell you what should display when this situation happens. But what it is expecting is the exception that you get when your height or breadth is negative.
Java Static Initializer Block
You are viewing a single comment's thread. Return to all comments →
Your answer is fail to pass the 6th test case.!!
Sorry. It should be "if (B <= 0 || H <= 0)". You can try again.
It is the same thing. And Answer comes by this.
Test 6 is testing for the upper bound of < 100. If you look in the constraints you will see that the number entered must be greater than -100 and less than 100. The test is failing because it tests a height of 100. The crazy thing that is missing is they do not tell you what should display when this situation happens. But what it is expecting is the exception that you get when your height or breadth is negative.
@catequil Thanks, you are right. But the constrains are actually: -100 <= B <= 100 -100 <= H <= 100
So the 100 should be included. I guess it's a mistake that Testcase 6 fails, when you take the input 100 for valid.