NEED help with this code, i need to put the code in place of(??????)

The code is suppose to enter the car's information and it compares which car has best finance mileage and cost of car.

#include<iostream>
using namespace std;
#include<string>
#define INT_MAX 100000
#define INT_MIN 0
using namespace std;


class Automobile
{
public:
    Automobile();
    void read();

    bool is_cheaper_than(??????) const;
    bool better_mileage_than(???????) const;
    bool better_finanace_than(??????) const;

    void print() const;
private:
    string name;
    float price;
    float mileage;
    float finance;


};

Automobile::Automobile()
{
name=" ";
price=INT_MAX;
mileage=INT_MIN;
finance=INT_MAX;

}

void Automobile::read()
{

cout<<"Model name:";
cin>>name;
cout<<"price";
cin>>price;
cout<<"miles per gallon:";
cin>>mileage;
cout<<"percent financing:";
cin>>finance;

}

bool Automobile::is_cheaper_than(?????) const
{
???????????

}
bool Automobile::better_mileage_than(?????) const

{

????????
}

bool Automobile::better_finance_than(?????) const
{
???????

}

void Automobile::print() const
{
cout<<"Model:" << name<<"\n"
    <<"price:" << price<<"\n"
    <<"Miles Per Gallon:" << finance<<"\n"
    <<"Financing:"<<"\n";
}




int main()

{
    Automobile best_in_price;
    Automobile best_in_mileage;Automobile best_in_fiance;   
    bool done = false;

while(!done)
{

    Automobile next;
next.read();

???????????????

    string answer;
cout<<"More Y/N";
cin>>answer;

if((answer) != "Y")
    done=true;
}


cout<<"\n\nnBest price:\n";
best_in_price.print();
cout<<"\n\nnBest mileage:\n";
best_in_mileage.print();
cout<<"\n\nnBest finanace:\n";
best_in_fiance.print();



}

Edited 4 Years Ago by c++bob1234: :

You have a couple of options:
You can pass it a float or a double
bool is_cheaper_than(float flt) const;

and fix your function to compare it's current value to the one passed in to the method...

Or you can pass it another Automobile class (reference or pointer)
and compare the internal value of the passed object to the current object's float value.

This article has been dead for over six months. Start a new discussion instead.