Polymorphism carbonfootprint interface program, JAVA Programming

(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.

Posted Date: 3/29/2013 2:19:27 AM | Location : United States







Related Discussions:- Polymorphism carbonfootprint interface program, Assignment Help, Ask Question on Polymorphism carbonfootprint interface program, Get Answer, Expert's Help, Polymorphism carbonfootprint interface program Discussions

Write discussion on Polymorphism carbonfootprint interface program
Your posts are moderated
Related Questions
Describe synchronization in respect to multithreading. With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared res

what are the advantages of packages and interface? why we use them? and what is the way of using packages and interfaces complete description with examples?

Excel File to Responsive CSS/HTML page Project Description: Excel file to be converted into a responsive form for a site. In the excel file you will see where the input field

Need to develop a Fantasy football Project Description: I am seeking to build a Fantasy football website. i already have an example of existing website. i want the exact same

Question: A new software engineer has joined Axistex Ltd. The systems analyst informs him that the organisation works with different operating system. The HR department works w

Develop a Farm Production System Project Description: I want software that will allow me to input/record the each day production of our farm and allow me to view the data bac

Which models are supported by JMS? Please, explain them. Ans) Publish or subscribe (pub/sub). This model permits a client (publisher) to send messages to a JMS topic. These mess

Translate Four Row Solitaires from Java Swing to Android. Project Description: There is a product known Four Row Solitaire listed in GitHub. I would like Swing GUI to be repl

Describe the if statement in Java ? All but the most trivial computer programs required to form decisions. They test a condition and operate in a different way based on the out

* Using a data structure to represent a set * Writing and using a checked exception * Extending the Exception class What should you upload via Blackboard? The files,