the definition of a class that has the following properties: The name of the class is secretType. The class has four member variables: name of type string, age and weight of type int and secretType height of type double. The class has the following member functions. secretType print()- outputs the data stored in the member variables with the appropriate titles. setName() set the name – setAge()- set the age setWeight()- set the weight setHeight()- 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 paramaters. – Write the definition of the member functions of the class as described in Part c. secretType Consider the following definition of the class myClass: class myClass { public: void setX(int a); //function to set the value of x. // postcondition: x:=a; void printX() const; // function to output x. static void printCount(); // function to output count. static void to incrementCount(); // function to increment count. // postcondition: count++; myClass (int a = 0); // constructor with default parameters // postcondition x = a; // if no value is specified for a, x = 0; private: int x; static int count; }; a. Write a C++ statement that initializes the member variable to 0. count b. Write a C++ statement that increments the value of by 1. count c. Write a C++ statement that outputs the value of count. d. Write the definitions of the functions of the class as described in its definition. myClass
the definition of a class that has the following properties: The name of the class is secretType. The class secretType has four member variables: name of type string, age and weight of type int and height of type double. The class secretType has the following member functions. print()- outputs the data stored in the member variables with the appropriate titles. setName() – set the name setAge()- set the age setWeight()- set the weight setHeight()- 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 paramaters. Write the definition of the member functions of the class secretType as described in Part c. Consider the following definition of the class myClass: class myClass { public: void setX(int a); //function to set the value of x. // postcondition: x:=a; void printX() const; // function to output x. static void printCount(); // function to output count. static void to incrementCount(); // function to increment count. // postcondition: count++; myClass (int a = 0); // constructor with default parameters // postcondition x = a; // if no value is specified for a, x = 0; private: int x; static int count; }; a. Write a C++ statement that initializes the member variable count to 0. b. Write a C++ statement that increments the value of count by 1. c. Write a C++ statement that outputs the value of count. d. Write the definitions of the functions of the class myClass as described in its definition.
TK1924%20-%20Tutorial%2001%20-%20Classes.docx