If your return type is int, any way your method should return int.
In this case, inside your external if elseyou still have blocks if, it means that inside the external if else, if non, if the condition is met, then it returns nothing.
In this case, you should always add a return statement at the end.
:
public int computeStyle(String season) {
if(season.equals("summer")){
if (this.style.equals("toque")){
return 8;
}
if (this.style.equals("sun visor")){
return 1;
}
if (this.style.equals("fedora")){
return 6;
}
}
else if(season.equals("winter")){
if (this.style.equals("toque")){
return 1;
}
if (this.style.equals("sun visor")){
return 8;
}
if (this.style.equals("fedora")){
return 7;
}
}
else return 5;
return 0;
}