I'm trying to create a method for my web-service however i receive this error listed in the title
Use of unassigned local variable 'totalroadtax'
This is how the user have to input 2 different variable to trigger the method in the webmethod
[WebMethod]
public double RoadTax(int engineCapacity, int vehicleAge)
{
double totalroadtax;
if (engineCapacity.Equals("600") && vehicleAge.Equals("12"))
{
totalroadtax = ((200.00 * 0.782) * (1.10));
}
return totalroadtax;
//return (engineCapacity - vehicleAge);
}
I declared my totalroadtax in my method, input some caluclation method and return the value. I checked the have the necessary information for this method to work but I still receive the error. Did i leave anything out here?