Chapter 12: Problem 12
Write the definition of a class that has the following properties: a. The name of the class is secretType. b. The class secretType has four member variables: name of type string, age and weight of type int, and height of type double. c. The class secretType has the following member functions. (Make each accessor function constant.) print—outputs the data stored in the member variables with the appropriate titles setName—function to set the name setAge—function to set the age setWeight—function to set the weight setHeight—function to set the height getName—value-returning function to return the name getAge—value-returning function to return the age getWeight—value-returning function to return the weight getHeight—value-returning function to return the height constructor—with default parameters: The default value of name is the empty string " ", and the default values of age, weight, and height are 0. d. Write the definition of the member functions of the class secretType, as described in Part c.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.