Stubbed function- cannot convert...

I would like for someone to explain what I got wrong and what that error means. I would also like to know how you got your answer as well.
#include <iostream>
#include <iomanip>
using namespace std;

float getUsageCost();
float getPeriodicCost();
float promptDevalue();
float promptInsurance();
float promptParking();
float promptMoleage();
float promptGas();
float promptRepairs();
float promptTires();
float getUsageCost();
float costUsage();
float costPeriodic();
void display(float costUsage, float costPeriodic);


float getUsageCost()
{
return 0.0;
}

float getPeriodicCost()
{
return 0.0;
}

float promptDevalue()
{
return 0.0;
}
float promptInsurance()
{
return 0.0;
}

float promptParking()
{
return 0.0;
}

float promptMileage(){
return 0.0;
}

float promptGas()
{
return 0.0;
}

float promptRepairs()
{
return 0.0;
}

float promptTires()
{
return 0.0;
}

float costUsage()
{
return 0.0;
}

float costPeriodic()
{
return 0.0;
}void display(float costUsage, float costPeriodic)
{
cout << "Success\n";
return;
}

int main()
{
float usageCost = getUsageCost();
float periodicCost = getPeriodicCost();
float devalue = promptDevalue();
float insurance = promptInsurance();
float parking = promptParking();
float mileage = promptMileage();
float gas = promptRepairs();
float tires = promptTires();

display(costUsage, costPeriodic);
return 0;
}
...what's the error? Also, you should wrap your stuff in [ code ] [ /code ] tags (no spaces).
evargasl wrote:
I would like for someone to explain what I got wrong

You didn't charge anyone for mending their car.


When I tried to compile your code the only actual compile error (as opposed to lots of warnings) was for
display(costUsage, costPeriodic);
since costUsage and costPeriodic are the names of functions and you probably meant to send the (not-very-sensibly-named) variables usageCost and periodicCost.

A "stub" is a sort of minimal function that is put there so that your code can actually compile, pending you actually writing the real content of that function.

In this case all your value-returning functions actually return a default value 0.0. Wish my garage did!


I think the idea is that you actually write some code in those functions!
Last edited on
Thank you for all your help! I realized what I have done wrong. it was a huge help!
Topic archived. No new replies allowed.