Question: public static String classify ( int volume ) { String carClass = ; if ( volume > = 1 2 0 ) {

public static String classify(int volume)
{
String carClass ="";
if (volume >=120)
{
carClass = "Large";
}
else if (volume <120)
{
carClass = "Mid-Size";
}
else if (volume <110)
{
carClass = "Compact";
}
else if (volume <100)
{
carClass = "Subcompact";
}
else
{
carClass = "Minicompact";
}
return carClass;
}
The classify method works as intended for some but not all values of the parameter volume. For which of the following values of volume would the correct value be returned when the classify method is executed?
Responses
80
90
105
109
115

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!