Question: Write a java program that will calculate carbon footprint of Car, Bicylce, and Building. The task require the following - Create interface CarbonFootprint - Create
Write a java program that will calculate carbon footprint of Car, Bicylce, and
Building. The task require the following
Create interface CarbonFootprint
Create Car class implement CarbonFootPrint interface and include the
following:
o Instance Variable gallons double
o Overload constructor that will initialize the gallon value
o Implement GetCarbonFootprint method that will display gas yields
how many pounds of carbon dioxide One gallon of gas yields
pounds of CO
Create Bicylce class implement CarbonFootprint interface and include the
following:
o Implement GetCarbonFootPrint method that will display Bicycle:
Create Building class implement CarbonFootprint interface and include the
following:
o Instance Variable squareFeet int
o Overload constructor that will initialize the squareFeet value
o Implement GetCarbonFootPrint method that will display building with
square feet yields how much cardi oxide
Simplified formula: Multiply the square footage by for the wood
frame, by for the basement, by for the concrete, and for the
steel squareFeet
Create following CarbonFootPrintTest class
OUTPUT:
Task :
Write a java program that will calculate carbon footprint of Car, Bicylce, and
Building. The task require the following
Create interface CarbonFootprint
Greate Car class implement CarbonFootPrint interface and include the
following:
Instance Variable gallons double
Overload constructor that will initialize the gallon value
Implement GetCarbonFootprint method that will display gas yields
how many pounds of carbon dioxide One gallon of gas yields
pounds of
Create Bicylce class implement CarbonFootprint interface and include the
following:
Implement GetCarbonFootPrint method that will display "Bicycle: "OUTPUT:
Bicycle:
Building with square feet:
Car that has used gallons of gas:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
