Question: Please solve by C++! ACTIVITY 7.6.2: Initialization and constructors. Jump to level 1 Define a default constructor that initializes the data members, string name, string

Please solve by C++!

Please solve by C++! ACTIVITY 7.6.2: Initialization and constructors. Jump to level

ACTIVITY 7.6.2: Initialization and constructors. Jump to level 1 Define a default constructor that initializes the data members, string name, string greeting, and integer number, with the default values "Void", "Unspecified", and 0, respectively. Ex: If the input is Huy 6485869 , then the output is: Name: Void, Greeting: Hello this is Unspecified, Number: 0 Name: Huy, Greeting: Hello this is Huy, Number: 6485869 Note: The class's print function is called first after the default constructor, then again after the inputs are passed to the setters. \begin{tabular}{r|c} 4 & \\ 5 & class Message \{ \\ 6 & public: \\ 7 & Message(); \\ 8 & void SetName(string messageName); \\ 9 & void SetGreeting(string messageGreeting); \\ 10 & void SetNumber(int messageNumber); \\ 11 & void Print(); \\ 12 & \\ 13 & private: \\ 14 & string name; \\ 15 & string greeting; \\ 16 & int number; \\ 17 & \}; \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!