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
Your class must contain the followings (20 points):Code a simple class in JAVA classed “Student. · Variables (name, age, addressStreet, city, state, zip, country) ·

1. Write the pseudocode to get the input of 10 integers from the user and add them up and output the total. (4 points) 2. Compute the output of following pseudocode. Assume that

Program of Declaration of variables in Java Program for declaring variables in Java, I've been trying so many codes for this but those codes didn't work well. Please write the

Java Programming 1. Discuss any five buzz words in Java. 2. Describe exception classes and also explain common exceptions in java. 3. Describe primitive and abstract data

State about the JVM? JVM is the acronym which stands for 'Java virtual machine'. JVM provides execution environment. JVM isn't platform independent. JVM is Java

Journal of how you came to AUB Write a web application using JavaScript, XML and CSS that contains a journal of major events and places on your journey to Bond University. The

Inheritance - is the inclusion of state and behavior of a base class in a derived class so that they are accessible in that derived class. The key benefit of Inheritance is that

Using Java, write the class Time which consists of the following: (a) three private integer data members (hours, minutes and seconds). (b) a constructor to initialise the dat

State the Verify phase of Java Program Development Before the bytecodes in an application are executed by the java interpreter, they are verified by the bytecode verifier in

We need an OpenGL - based visualisation of an OBJ-File that was created out of Maya3D. (important: we have to use OpenGL with Java - JOGL) In other words: we have an OBJ-file (a