Discuss an abstract class carbon footprint

Assignment Help Basic Computer Science
Reference no: EM131610302

Question: (Carbon Footprint Abstract Class: Polymorphism) Using an abstract class with only pure virtual functions, 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 abstract class Carbon Footprint with only a pure virtual get Carbon Footprint method. Have each of your classes inherit from that abstract class and implement the get Carbon Footprint method to calculate 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 pointers to those objects in a vector of Carbon Footprint pointers, then iterates through the vector, polymorphically invoking each object's get Carbon Footprint method. For each object, print some identifying information and the object's carbon footprint.

Reference no: EM131610302

Questions Cloud

Define what is their core philosophy : What is their core philosophy. What are the pros and cons of this philosophy. Elaborate
Develop polymorphic banking program using account hierarchy : (Polymorphic Banking Program Using Account Hierarchy) Develop a polymorphic banking program using the Account hierarchy created in Exercise.
Explain description of the crime that took place : Outline the level of court that was assigned to the case local/state, municipal, or federal and the reason why that level was appropriate
Which employers are subject to affirmative action laws : Which employers are subject to Affirmative Action laws? What potential impact does Affirmative Action have on employees and the workplace?
Discuss an abstract class carbon footprint : (Carbon Footprint Abstract Class: Polymorphism) Using an abstract class with only pure virtual functions, you can specify similar behaviors for possibly.
Explore types of principal-agency relationships : Explore types of principal-agency relationships and determine what type of relationship exists in this case between the driver, Jose Carcamo, and the company.
Define identification that eventually proved unreliable : Early forensic scientists developed methods of identification that eventually proved unreliable
Define the function-template definition : The template parameters of a function-template definition are used to specify the types of the arguments to the function.
How would you configure the activation scheme : A police manager responsible for setting up a new in-car video system, what technology would you include

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Discuss what is the abstract base classes

(Abstract Base Classes) Suggest one or more levels of abstract base classes for the Shape hierarchy discussed in this chapter and shown in Fig.

  Give a definition for optimum performance

Give a definition for optimum performance.Would that definition change as you look for a personal computer at home versus helping your employer purchase a web server to accept customers' orders over the Internet.

  Explain why is a two stage pipeline unlikely to reduce

a. Explain why is a two stage pipeline unlikely to reduce the instruction cycle time by 50% in comparison to no pipeline usage?

  Write the null and alternative hypotheses

In this context, explain what would happen if the professor makes a Type I error.

  Determine the largest force p that can be applied to rope

The bucket has a mass of 20 kg and the coefficient of static friction between the pulley and the pin is µ= 0.3. Neglect the mass of the pulley and assume that the cable does not slip on the pulley.

  Estimate t(2003) and describe what it measures

Economics The graph shows the annual spending on health care in the U.S. for the years 1992 to 2006 (using projections for the years after 1998.) Let T(y) be the total annual spending on health care in year y.

  State whether each reference is hit or a miss

Assume a cache has 16 1-word blocks and is initially empty. Placement is by direct mapping. Also, state whether each reference is a hit or a miss.

  Find a number n so that the nth partial sum

The following series converges. Find a number N so that the Nth partial sumSN has a remainder less that 1/200 . You must justify that your answer.

  Us exporting industries affected

With the tariffs imposed, how is the level of exports in other U.S. exporting industries affected? Explain Answers.

  How the system processes behave

How well would a cluster-based analysis mechanism for anomaly-based intrusion detection work with this system? Justify your answer.

  True or false on computer science

True or False 1. If a computer uses hardwired control, the microprogram determines the instruction set for the machine.

  Length of the array or arraylist

Write a short Java application that stores words in an Array or ArrayList. You get to pick the number of words to store. Generate a random number between 0 (inclusive) and the length of the Array or ArrayList (exclusive).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd