#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_MIN;
mileage=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();
}
c++bob1234 0 Newbie Poster
c++bob1234 0 Newbie Poster
piyush3dxyz 0 Newbie Poster
c++bob1234 0 Newbie Poster
c++bob1234 0 Newbie Poster
c++bob1234 0 Newbie Poster
hstudent 0 Newbie Poster
Saith 74 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.