Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 17:20, jashaikamatuteowwp1p
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 3
image
Computers and Technology, 22.06.2019 06:00, wbrandi118
What role do chromosomes play in inheritance?
Answers: 1
image
Computers and Technology, 22.06.2019 11:00, bombbomb2157
Eva has many contacts on the professional networking site she uses which contacts are considered second degree
Answers: 3
image
Computers and Technology, 22.06.2019 16:10, Olaf2018
Drag each label to the correct location on the imagelist the do’s and don’ts of safeguarding your password. keep yourself loggedin when you leave your computer. don’t write your password down and leave it whereothers can find it. share your password with your friends. each time you visit a website, retain the cookies on your computer. use a long password with mixed characters.
Answers: 1
Do you know the correct answer?
Make a difference (carbonfootprint interface: polymorphism) using interfaces, as you learned in thi...

Questions in other subjects:

Konu
Mathematics, 05.03.2021 14:10
Konu
Mathematics, 05.03.2021 14:10
Konu
Computers and Technology, 05.03.2021 14:10