Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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++!
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started