String and weight as protected members

Assignment Help Business Management
Reference no: EM132325441

Define a Pet class that stores the pet's name as a C++ string and weight as protected members. Add appropriate constructors, accessor functions, and mutator functions. Also define a function named getLifespan that returns a string with the value "unknown lifespan." string getLifespan();

Next, define a Dog class that is derived from Pet. The Dog class should have a private member variable named breed that stores the breed of the dog as a C++ string. Add appropriate constructors, mutator functions, and accessor functions for the breed variable. Redefine the getLifespan function to return "Approximately 7 years" if the dog's weight is over 100 pounds and "Approximately 13 years" if the dog's weight is under 100 pounds.

In the driver,

  • need Pet object and Dog pointer.
  • Ask the user for the information to set the data members for a Pet object.
  • Print the lifespan of a Pet.
  • Ask the user for the number of dogs.
  • need dynamic array of Dog objects.
  • Ask the user for the information to set the data members for each Dog object.
  • Print the lifespan for all the dogs.
  • Don't forget to delete your Dogs!

Reference no: EM132325441

Questions Cloud

Operations and supply chain controls and measurements : Operations and supply chain controls and measurements include forecasting methods for managing supply chain. Discuss forecasting methods-models for managing
Financial and quantitative data in decision-making process : Analyze financial and other quantitative data in the decision-making process. Leverage diversity to optimize performance in the global marketplace.
Explain any additional supply chain challenges : Explain any additional supply chain challenges you anticipate if attempting to make your product in your chosen country and selling product in other countries
Describe the current evaluation models in HPT literature : Describe the current evaluation models in HPT literature. Describe the theoretical variables for comprehensive performance evaluation.
String and weight as protected members : Define a Pet class that stores the pet's name as a C++ string and weight as protected members.
Computer can be programmed to carry out different tasks : Is an iphone or android phone a single-function device, or is it a programmable computer?
Why is it important to protect organizational assets : Why is it important to protect organizational assets against malware? What tools other than the ones provided by Microsoft can help fight against malware?
Examples of loop structures using comments : Examples of loop structures using comments in your code. Be sure your examples address each of the following:
Describe how to simulate a queue using two stacks : Describe how to simulate a queue using two stacks, L and R: Each of the two primary queue operations, enqueue and dequeue, should be implemented by performing

Reviews

Write a Review

Business Management Questions & Answers

  What traits does this leader appear to possess

What traits does this leader appear to possess? What behaviors does this leader engage in? Is this leader relationship-oriented or task-oriented? Provide an example to support your view. How does this leader try to motivate his or her followers?

  Can a company exist without a formal hr department

Can a company exist without a formal HR department? How does increasing productivity intersect with strategic prescence

  Types of conflicts at work or as part of a team

Describe how interpersonal and intergroup conflicts differ. Describe a time you personally witnessed one of these types of conflicts at work or as part of a team. (If you have not observed any, interview a worker to find an example.)

  What has cisco done to maintain its unique culture

What has Cisco done to maintain its unique culture? What advice do you have for John Chambers to manage Cisco's culture through the transition?

  Evaluative criteria for national economic performance

Building on our critiques of using GDP as the dominant evaluative criteria for national economic performance, I would like you to: 1. Discuss what you think of GDP and how it has been developed and is utilized.

  Describe the relationship between creativity and change

Describe the relationship between creativity and change, identify characteristics of creative people and creative organizations, and discuss innovation

  Explain the elasticity of demand

1. Explain the elasticity of demand? Why is this important when looking at the demand for healthcare?

  Describe briefly a disadvantage of ABC

Describe briefly a disadvantage of ABC. At the end of this lesson you should be able to: understand the basic nature of Activity Based Costing (ABC)

  Opinion about the current economic status

What is your opinion about the current economic status? Currently US economy is experiencing low inflation rate (

  Explain community property rights

Explain Community Property Rights and the recognized two kinds of property. As of 2015, how many states have adopted the concept

  Financial trending of the companies

Compare the financial trending of the companies beginning in 2000 until the present. Add to the Wiki What does the trending show?

  Understanding of external and internal environments of firm

The traditional approach to strategic management relies on an understanding of the external and internal environments of a firm in order to chart an appropriate route to competitive advantage

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