Question: In C + + please Main.Cpp Can not change at all main.cpp #include #include Car.h using namespace std; int main ( ) { int

In C++ please
Main.Cpp Can not change at all
main.cpp
#include
#include "Car.h"
using namespace std;
int main(){
int numGallons;
int mpgCity;
int mpgHighway;
Car myCar;
cin >> numGallons;
cin >> mpgCity;
cin >> mpgHighway;
myCar.SetGallons(numGallons);
myCar.SetMpgCity(mpgCity);
myCar.SetMpgHighway(mpgHighway);
myCar.PrintInfo();
return 0;
}
Car.cpp
#include
#include
#include "Car.h"
using namespace std;
void Car::SetGallons(int gallons){
fuelTankCapacity = gallons;
}
void Car::SetMpgCity(int MPGCity){
mpgCity = MPGCity;
}
void Car::SetMpgHighway(int MPGHighway){
mpgHighway = MPGHighway;
}
// TODO: Implement GetGallons(int ) function
// TODO: Implement GetMpgCity(int ) function
// TODO: Implement GetMpgHighway(int ) function
// TODO: Implement PrintInfo() function to output mpgCity, mpgHighway, and range
Car.h
#ifndef CARH
#define CARH
#include
using namespace std;
class Car {
private:
int fuelTankCapacity;
// TODO: Declare mphCity member (int)
// TODO: Declare mphHighway member (int)
public:
void SetGallons(int gallons);
// TODO: Declare SetMpgCity(int ) function
// TODO: Declare SetMpgHighway(int ) function
int GetGallons() const;
// TODO: Declare GetMpgCity() function
// TODO: Declare GetMpgHighway() function
// TODO: Declare PrintInfo() method to output mpgCity, mpgHighway, and range
}
#endif
In C + + please Main.Cpp Can not change at all

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!