I need help with this program which I have a function that calculates this formula for total house cost and then have an instruction function that asks for the input, then in main has the output. Can anyone tell me waht I am doing wrong, I think I have to return something in the instructions function but I don't know what! Please help! Thanks!
float totalHouseCost (float initial, float fuel, float taxRate)
{
float totalFuelCost = fuel * 5; // Fuel for 5 years
float totalTaxes = taxRate * initial * 5; // Taxes for 5 years
float totalCost = initial + totalFuelCost + totalTaxes; /*Initial House cost
+ fuel cost for 5 years + Tax Rate for 5 years */
}
You need to return a float in this function. You have a variable that you calculate (totalCost), but then do nothing with it, so presumably you are supposed to return it:
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.