Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Code C++

In this project, you will create a class called Camel. Below, we will
describe what will define a Camel. You will also create a main function in
which you will create objects of type Camel to test the functionality of
your new user-defined type. In the main, you will create enough objects
of your new type(s) in order to adequately test their functions. It is up to
you to do this properly.
Your Camel class is to contain the following:
Member variables:
• a float for weight
• a short for age (months)
• a string for name
• a char for gender
• a bool to indicate whether alive (or not)
Member functions:

• a default constructor that creates a dead camel
• a constructor that you can pass values to so as to establish its
gender, weight, age, and name; it will default to alive.
• a print function that will output to the screen the attributes of that
camel in a nice, easy to read format.
• an age_me function that returns nothing but increments the object's
age.
• an eat function that increases the weight of the camel by a random
amount from 0.1% to 5.0% of the camel' current weight.
Note: Think very carefully about writing the above functions and how
they should be used. There are indeed circumstances when some
functions should not execute. For example, a dead camel shouldn't eat
anything.

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
    Recommended textbooks for you
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education