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
An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm.  ActionForm handles the session state for web application and the ActionForm object is automatically p

Develop an E-commerce website I prefer this website to be coded with JAVA since I have heard this is safer than PHP is. Though, if this is not possible I am willing to go with P

What do you mean by a task's priority and how can we use it in scheduling ?

You can now implement the main program with its user interface for this assignment in the class MovieBrowse. This will provide a simple, command-line, interactive interface to prov

Differentiation between an Applet and an Application ?

Explain the both HashSet and TreeSet? HashSet is an unordered, unsorted Set. It's a Collection set which restrict duplicate elements and also repositioning of elements. I

Write a program in Javascript that will read in an XML file. This file will contain details of devices maintained by the IT department of an organisation including an ID number, de

Mention any five applications of Artificial Intelligent System? 1)Medical Diagnosis 2)Robots 3) Games 4) Business intelligence 5)Image Recognition.

What are the different types of messages available in the JMS API? Ans) Message, TextMessage, BytesMessage, StreamMessage, ObjectMessage, MapMessage are the dissimilar messages

Need Remote Synchronization tool for folders and files? Project Description:                 We want a tool to synchronize the content of one or more folders on the file syst