Have to calculate two returning values: The fat percentage and the Fat calories in a food item
My only inputs are going to be the fat grams and the total calories.
I'm getting a red line underneath getFatPercent on line 28
It says "Error: no instance of overloaded function 'getFatPercent' matches the arguement list"
Also since I haven't been able to run it yet, if you see any errors please let me know!
Your function prototypes need to match your function definitions.
This: double getFatCals(int, double, int); doesn't match this: int getFatCals(int fatGram)
The function names are the same, but the parameter lists aren't.
Your call to getFatPercent is wrong. The compiler is telling you that it does not take 1 argument. You called it and only passed one argument, but you declared it and defined it to take 2 arguments. I think you mean for line 28 to say: fatPercent = getFatPercent(fatCals, totalCals);
All that business with the casting and the dividing already takes place inside the function, so there's no need to do it in main where you call the function.