Must be in C++. Governments and companies worldwide are becoming increasingly concerned with carbon footprints (annual releases of carbon dioxide into the atmosphere) from buildings burning various types of fuels for heat, vehicles burning fuels for power, and the like. Many scientists blame these greenhouse gases for the phenomenon called global warming. Create three small classes unrelated by inheritance—classes Building, Car and Bicycle. Give each class some unique appropriate attributes and behaviors that it does not have in common with other classes. Write an abstract class CarbonFootprint with only a pure virtual getCarbonFootprint method. Have each of your classes inherit from that abstract class and implement the getCarbonFootprint method to calculate an appropriate carbon footprint for that class (check out a few websites that explain how to calculate carbon footprints). Write an application that creates objects of each of the three classes, places pointers to those objects in a vector of CarbonFootprint pointers, then iterates through the vector, polymorphically invoking each object’s getCarbonFootprint method. For each object, print some identifying information and the object’s carbon footprint.
Header.h
#pragma once
#include<iostream>
#include<string>
#include<iomanip>
#include<vector>
using namespace std;
//abstract parent class
class CarbonFootprint {
public:
virtual void getCarbonFootprint();
};
void CarbonFootprint::getCarbonFootprint()
{
cout << "Parent Display" << endl;
}
//child classes
class Building : public CarbonFootprint {
public:
virtual void getCarbonFootprint();
int walls = 4;
int SQFT = 800;
};
void Building::getCarbonFootprint() {
cout << endl;
cout << "Building displayed" <<
endl;
double carbon = 0.859;
cout << "Your building emits " << carbon
<< " tons of CO2" << endl;
cout << "Your home has " << walls <<
" walls" << endl;
cout << "Your home is " << SQFT << "
Square feet" << endl;
cout << endl;
}
class Car : public CarbonFootprint {
public:
virtual void getCarbonFootprint();
int tanksize = 10;
int mpg = 45;
};
void Car::getCarbonFootprint() {
cout << endl;
cout << "Car displayed" << endl;
int carbon = 4;
cout << "Your car emits " << carbon
<< "tons of CO2" << endl;
cout << "Your car has a gas tank size of: "
<< tanksize << endl;
cout << "Your car gets " << mpg << "
miles per gallon." << endl;
cout << endl;
}
class Bicycle : public CarbonFootprint {
public:
virtual void getCarbonFootprint();
string frametype = "J Frame";
};
void Bicycle::getCarbonFootprint() {
cout << endl;
cout << "Bicycle displayed" << endl;
int carbon = 0;
cout << "Your bicycle emits " << carbon
<< " tons of CO2" << endl;
cout << "Your bicycle frame is " <<
frametype << endl;
cout << endl;
}
main.cpp
//preprocessor directives
#include<iostream>
#include<string>
#include<iomanip>
#include<vector>
#include"Header.h"
using namespace std;
int main()
{
char loop = 'y';
int selection;
//while loop for program
while (loop == 'y' || loop == 'Y')
{
cout <<
"**************************************************" <<
endl;
cout << "Hello! Welcome to Rico's carbon
footprint program." << endl;
cout <<
"**************************************************" <<
endl;
cout << "Emissions are a big threat to our
planet. Do your part, see what emissions you cause by using my
program. " << endl;
cout << "What would you like to do?" <<
endl;
cout << endl;
cout << "1. Display possessions, their
attributes and carbon emission" << endl;
//vector
vector<CarbonFootprint *> CarbonTrak;
CarbonTrak.push_back(new Building());
CarbonTrak.push_back(new Car());
CarbonTrak.push_back(new Bicycle());
cin >> selection;
switch (selection)
{
case 1:
//for loop that iterates through
vector
for
(vector<CarbonFootprint*>::iterator iter =
CarbonTrak.begin(); iter != CarbonTrak.end(); ++iter) {
(*iter)->getCarbonFootprint();
}
break;
}
cout << "If you would like to return to the main
menu, press 'y', to quit press 'n'.(y/n)" << endl;
cin >> loop;
system("cls");
}// endl while loop
cout << "Thank you for using my program!
Enjoy your day." << endl;
system("pause");
return 0;
}

Must be in C++. Governments and companies worldwide are becoming increasingly concerned with carbon footprints (annual...
Write a program in C++ with comments! Create an abstract class Property, containing the data items owner, address and price. Add an abstract method showOwner(). Also provide getter/setters for all the data items. Make validations if necessary in the setter so that no invalid values are entered. Create a class House, to inherit the Property class. This class should contain additional data item – yardSize – an integer – the size of the yard of the house, getter and setter...
C++ Programming Assignment S Mammal Lab This lab's goal is to give you some practice using inheritance, virtual functions, pointers, dynamic memory allocation, random numbers, and polymorphism. To complete the lab implement the following steps: Create a class called Mammal. All mammals have a weight and a name, so its data should be the mammal's weight and name. Provide a default constructor that sets the mammal's weight to 0 and name to null, and another constructor that allows the weight...