9.16 and 9.17 C++ u has been be be to an empty square. After wherever the second
ID: 3820826 • Letter: 9
Question
9.16 and 9.17 C++ u has been be be to an empty square. After wherever the second play- the won or is draw. If you feel each move, determine whether the game or moves for one of the players. ambitious, modify your program so that the computer makes second. Also, the player to specify he or she to go tic-tac-toe If you feel exceptionally ambitious, develop a program that will play three-dime take many on a 4-by-4-by-4 board. [Caution: This is an extremely nsional weeks of effort!) challenging project that could 9.16 (Friendship) Explain the notion of friendship. Explain the negative aspects of friendship as described in the text. 430 Chapter 9 Classes: A Deeper Look: Throwing Exceptions 9.17 (constructor overloading) Can a Time class definition that includes both of the following constructors: Time( int h 0, int m 0, int s 0 Time O be used to default construct a Time object? If not, explain why. 9.18 (Constructors and Destructors) What happens when a return type, even void, is specified for a constructor or destructor?
Explanation / Answer
9.16)
Advantages
They provide a degree of freedom in the interface design options.
We can able to access the other class members in our class if,we use friend keyword.
We can access the members without inheriting the class.
Disadvantages
The major disadvantage of friend functions is that they require an extra line of code when you want dynamic binding.
A derived class can’t inherit friend functions.
Since the friend function can access to the data members and member functions which may be either private or public of any class remaining outside of the class so it can break the security.
9.17)
Time(int h=0, int m=0, int s=0);
Time();
Yes, they can be used to default constructor.
If we do not pass any paramter to: Time(int h=0, int m=0, int s=0);
it behaves like default constructor
9.18)
If we add void is specified for a constructor or destructor, then
they becomes like regular function
PLEASE let me know in case of any issue.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.