[Solved] CarbonFootprint Interface

Click And Check all our Assignments
Click Here and Upload you Assignment for Free!


100/100 Trustscore on scamadviser.com

10 USD $

Category: Tag:

CarbonFootprint Interface: Polymorphism Using interfaces, you can specify similar behaviors for possibly disparate classes. 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. Write an interface CarbonFootprint with a getCarbonFootprint method. Have each of your classes implement that interface, so that its getCarbonFootprint method prints out an appropriate message (e.g., this message from Building CarbonFoot).Write an application that creates objects of each of the three classes and one interface reference variable, assign each object to the interface reference variable, and then invoke each object’s getCarbonFootprint method by means of dynamic method resolution. For each object, print a simple message (e.g., this message from Building CarbonFoot= 123… something).


There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CarbonFootprint Interface
10 USD $