C++ (Default Constructor, Setter, Getter and Display Function) Modify the following C++ Code so that it uses:
Question:
Modify the following C++ Code so that it uses:
A Default Constructor to Initialize the Attributes or Data Members. A Setter Function to set the value of data members. A Getter Function to display all data members.
and
Creates the Record of 2 cars and display it
#include
using namespace std;
class car
{ public: string Manufacturer; string Model ; int Chassis ; string Color ; float Price ; float Tank ; float TvScreen; int Airbags;
public:
car(string man,string mod,int cha,string col,float pr,float tank,float tv,int air) {
Manufacturer=man; Model=mod; Chassis=cha; Color=col; Price=pr; Tank=tank; TvScreen=tv; Airbags=air; }
void upgrade_Airbags(int bags) { Airbags=bags; }
void display() { cout cout cout cout cout cout cout cout cout cout cout cout cout cout cout } };
int main() { car obj("Ford","Ertiga",5,"grey",45000,78.5,4.5,2);
obj.display(); cout" ";> cout"after> cout obj.upgrade_Airbags(6);
obj.display();
return 0; }