Multiple Choice
Consider the getArea method from the textbook shown below: public int getArea()
{
If (width <= 0) { return 0; } // line #1
If (width == 1) { return 1; } // line #2
Triangle smallerTriangle = new Triangle(width - 1) ; // line #3
Int smallerArea = smallerTriangle.getArea() ; // line #4
Return smallerArea + width; // line #5
}
If line #1 was eliminated from the method, what would be the result when calling getArea?
A) A negative or zero width would cause problems.
B) Nothing - the method would still work correctly.
C) We would lose our only recursive case.
D) A positive width would reduce the correct area by 1.
Correct Answer:

Verified
Correct Answer:
Verified
Q53: Given the following class code: public class
Q54: Which of the following statements about palindromes
Q55: Consider the getArea method from the book
Q56: What is the purpose of a recursive
Q57: Complete the code for the calcPower recursive
Q59: Complete the code for the calcPower recursive
Q60: Consider the problem of arranging matchsticks so
Q61: Which of the following strings is a
Q62: Complete the following code snippet, which is
Q63: Which of the following statements is correct?<br>A)