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
Java developer with spring framework prerequisite from anywhere Let me know that you have proven experience in java with spring frame work. Send some sample data and provide inf

1) Listing of the source code ( named Rainfall.java ) for your program 2) Two sample output/execution/runs of your program Optional Group Work: This assignment may be done in

What is Overriding? When a class explains a method using the similar name, return type, and arguments as a method in its superclass, the method in the class overrides the metho

Develop an ehospital project Project Description: I am preparing ehopsital project.for the requires of hospital in that patient registration and billing module and stores mod

how can i add script code in anouncement of a channel in a massneger the massnegr suport that but do not published it please help me please:((((((((((((((((((((((((((((((((((((((((

Comparable interface: The "Comparable" allows itself to compare with other same types of object. The function compareTo() is specified in the interface. Several of the standa

Java Is For Real Java has a lot of hype however much of it is deserved. Java is very well matched for many modern problems Using more CPU time and memory but less programmer

I have to write a several line currency exchange rate calculator.it wants me to use a variable and prompt var dollarAmount = Prompt("Enter amount in U.S. dollars:"); and give t

Differentiation between an Applet and an Application ?

I need a chart and how this works with java? The functions itself.