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
Ask question ##title.. ????? ?????#title.. ????? ?????#title.. ????? ?????Minimum 100 words accepted#

Don''t know how to write this, can anyone help me? http://wikisend.com/download/660980/Moving Blobs.zip

write code employe managment

Write a program on Filling Rectangles ? The drawRect() method draws an open rectangle, a box if you prefer. If you need to draw a filled rectangle, use the fillRect() method. O

Calculate the kilometer within an hour? class Car { String licensePlate = ""; // e.g. "New York 543 A23" double speed = 0.0; // in kilometers per hour doubl

JavaScript is an extremely powerful object-based (or prototype-based) language. It is not a full-blown OOP (Object-Oriented Programming) language, like Java, however it is an objec

Project Requirements Write and test a Java program to play Minesweeper using Model-View-Presenter design (The model is an interface defining the data to be displayed or other

How can you define a consistent web design? Why is it needed? A consistent excellent designed website is generated for common public which permits users to attain what they nee

The break statement is utilized for terminating the current While or For loop and after that transferring program control towards statement just after the terminated loop. The foll