Polymorphism carbonfootprint interface program, JAVA Programming

Assignment Help:

(CarbonFootprint Interface: Polymorphism) Using interfaces, as you learned in this chapter, 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 ICarbonFootprint with aGetCarbonFootprint method. Have each of your classes implement that interface, so that its GetCarbonFootprint method calculates 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 references to those objects inList, then iterates through the List, polymorphically invoking each object's GetCarbonFootprint method.


Related Discussions:- Polymorphism carbonfootprint interface program

Need jvc everio stream converter, Need JVC Everio stream converter Proje...

Need JVC Everio stream converter Project Description: JVC Everio is a brand of cameras capable of real time streaming/ encodinig. To get the video from a PC or a mobile de

I want android developers, Project Description: I require some android d...

Project Description: I require some android developers in order to outsource projects. I am looking for good price and good quality. Skills required: Java, Android

Implement the list calss, Your next task is to implement the MovieList clas...

Your next task is to implement the MovieList class that manages the details for a list of DVD Movies read from the specified data file. The constructor will include a parameter tha

Determine the meaning of finalize, Determine the meaning of finalize W...

Determine the meaning of finalize When  a  finalize method  is  defined  in  a  class,  Java  run  time  calls  finalize() whenever  it's  about  to  recycle  an object  of  t

We want an e commerce site, We want an E Commerce site Project Descripti...

We want an E Commerce site Project Description: We want an E Commerce site like fifacointrader.. You must have experience with that kind of work We will award the proje

What is arpanet and who developed it, What is ARPANET and who developed it?...

What is ARPANET and who developed it? ARPANET stands for Advanced Research Projects. The initial reasons were to communicate along with and share computer resources between mainl

What is a framework, A framework is made up of the set of classes which per...

A framework is made up of the set of classes which permit us to use a library in a best possible way for a particular requirement.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd