Answered step by step
Verified Expert Solution
Link Copied!

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++!

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

What do you mean by dual mode operation?

Answered: 1 week ago

Question

Explain the difference between `==` and `===` in JavaScript.

Answered: 1 week ago