Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the header file Car.h for the Car class. The Car class has three data memb

ID: 3828555 • Letter: W

Question

Write the header file Car.h for the Car class. The Car class has three data members: miles_per_gallon (double), fuel (double), and model (string). The Car class has a constructor that initializes each data member. The Car class has four additional member functions:

get_model : no parameters, returns model

drive : double miles parameter, returns nothing

add_fuel : double gallons parameter, returns nothing

low_on_fuel : no parameters, returns true or false

Do not provide the implementation of the member functions.

Explanation / Answer

Car.h

#ifndef Car_H
#define Car_H
class Car
{
public:

Car();
Car(double miles_per_gallon, double fuel, string model);

// Function declarations
void add_fuel(double gallons);


void drive(double miles);


string get_model();

bool low_on_fuel();


private:

//Declaring variables
double miles_per_gallon;
double fuel;
string model;
};
#endif

_______________Thank You