Given the Vehicle class from the book. Use it to create two car variables of you
ID: 3643129 • Letter: G
Question
Given the Vehicle class from the book. Use it to create two car variables of your choice.Then write one if statement to see which car has the largest fuel capacity.
// Declare the Vehicle Class
class Vehicle {
// These are now private
int passengers; // number of passengers
int fuelcaps; // fuel capacity in gallons
int mpg; // fuel consumption in miles per gallon
public:
// this is a constructor for Vehicle.
Vehicle (int p, int f, int m) {
passengers = p;
fuelcap =f;
mpg = m;
}
// Compute and return the range.
int range() { return mpg * fuelcap; )
// Accesor function.
int get_passengers () { return passengers; }
int get_fuelcap;
int get_mpg() { return mpg; }
};
void main(void)
{
}