Solved

Consider the GetArea Method from the Textbook Shown Below

Question 4

Multiple Choice

Consider the getArea method from the textbook shown below. public int getArea()
{
If (width <= 0) { return 0; } // line #1
Else if (width == 1) { return 1; } // line #2
Else
{
Triangle smallerTriangle = new Triangle(width - 1) ; // line #3
Int smallerArea = smallerTriangle.getArea() ; // line #4
Return smallerArea + width; // line #5
}
}
Where is/are the recursive call(s) ?


A) line #1
B) line #2
C) lines #1 and #2
D) line #4

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions