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
how to imlement thomas'' write rule?

SMTP (Simple Mail Transfer Protocol) permits two mail servers to communicate using a easy language, and gives a step-by-step protocol for exchanging information. SMTP delivers m

Give the example of mixing data type in java? Mixing Data Types Order can form a difference while data types are mixed. For example, 1 / 2 * 3.5 = 0.0 3.5 * 1 / 2 = 1.75 3.5 /

JNLP/ Java Application - GUI and Backend Projects Project Description: I am looking for assist in making changes to a complex java application. System launches from web pa

What is the difference between preemptive scheduling and time slicing? Under preemptive scheduling, the highest priority task executes unless it enters the waiting or dead stat

2. Problem Description: A Java program needs to be written to display the result of following operations based input character. The table for input character with operations is : I

I''ve been trying to get this java program to work but im lost and Im stuck ! The factorial of a positive integer N, denoted by N! N!=1*2*...*N Using subprograms and f unctions,c

can you explain me the er diagram for the online doctor system

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

Java platform is a software-only platform independent, which runs on top of other hardware-based platforms like WINDOWS, UNIX, NT etc.   The Java platform has 2 main com