Beginning programmer...I keep getting a missing return value error on the following block of code.
/**
* Calculates the season charge based on the size of the lawn
*/
public String calculateCost()
{
double cost;
double area = calculateArea();
if(area < 400)
cost = 25*NUM_OF_WEEKS;
if(area > 400 || area < 600)
cost = 35*NUM_OF_WEEKS;
else
cost = 50*NUM_OF_WEEKS;
return;
}
Even if I indicate return cost;, I get another type of error. Any suggestions??
Thanks in advance...
/**
* Calculates the season charge based on the size of the lawn
*/
public String calculateCost()
{
double cost;
double area = calculateArea();
if(area < 400)
cost = 25*NUM_OF_WEEKS;
if(area > 400 || area < 600)
cost = 35*NUM_OF_WEEKS;
else
cost = 50*NUM_OF_WEEKS;
return;
}
Even if I indicate return cost;, I get another type of error. Any suggestions??
Thanks in advance...