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 20
pounds of CO2)
- Create Bicylce class implement CarbonFootprint interface and include the
following:
o Implement GetCarbonFootPrint method that will display Bicycle: 0
- 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 50 for the wood
frame, by 20 for the basement, by 47 for the concrete, and 17 for the
steel (squareFeet *(50+20+47+17))
- Create following CarbonFootPrintTest class
OUTPUT:
Task 2:
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 20
pounds of CO2)
Create Bicylce class implement CarbonFootprint interface and include the
following:
Implement GetCarbonFootPrint method that will display "Bicycle: 0 "OUTPUT:
Bicycle:
Building with 2500 square feet: 335000
Car that has used 10.00 gallons of gas: 200.00
Write a java program that will calculate carbon

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!