Question: in c++ please Define a default constructor that initializes the data members, integer mileage, string renter, and integer gas Tank, with the default values 1,

Define a default constructor that initializes the data members, integer mileage, string renter, and integer gas Tank, with the default values 1, Void;, and 0 , respectively Ex. If the input is 135000 Ben 180, then the output is: Mileage: 1, Renter: Void, Gas tank: Mileage: 135000 , Renter: Ben, Gas tank: 16e Note. The class's print function is called first after the defau Eonstructor, then again after the inguts are passed to the setters: 2 . Hinclude string? using namespace std; class Rentalcar 1 public: Rentalcar(); void sethileage(int rentalcarmlleage); void setrenter (string rentalcarkenter); void setGastank(int rentalCangas Tank); void Print(): private: int mileage; string renter; int gastank; yr your code goes here if 16. Object-Oriented Programining in C++ homes >15.6. Intitalizaton and constructors Note The class's print function is called first after the default constructor, then again after the inputs are passisd to the setters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
