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 12:00
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 22.06.2019 23:00
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
You know the right answer?
Make a difference (carbonfootprint interface: polymorphism) using interfaces, as you learned in thi...
Questions
question
History, 03.08.2019 18:00
question
Advanced Placement (AP), 03.08.2019 18:00