subject

Make a difference (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. give each class some unique appropriate attributes and behaviors that it does not have in common with other classes. write an interface carbonfootprint with a getcarbonfootprint 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 in arraylist , then iterates through the array-list, polymorphically invoking each object's getcarbonfootprint method.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Font size, font style, and are all aspects of character formatting.
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? explain the basis for your answer. with a significant economic recovery, what do you think will happen to future enrollments in graduating engineering programs?
Answers: 1
You know the right answer?
Make a difference (carbonfootprint interface: polymorphism) using interfaces, as you learned in thi...
Questions
Questions on the website: 13722363