Friend function (answer all that apply must be defined in the class for which th
ID: 3826251 • Letter: F
Question
Friend function (answer all that apply must be defined in the class for which they are friends are not members of the class for which they are friend can only be friends for one class must be designated friend by the class that they can secede can access private date of a class my data {string name;} is name private public protected or none of these? struck my data {string name} Is name private public protected or none of these? Write the output as it would Appear on the screen #include using name space std; int vol(int); int vol (int, int, int); int main() {coutExplanation / Answer
19)a,e
20)private
Reason: by default all the members of the class are private
21)b
Reason: by default all the members of the struct are private
22)2748
Reason: by calling the cout<<vol(3)
The function vol(int s) will be called by passing 3 as input>that function returns 27 to the main function
So it prints 27
Later when cout<<vol(2,4,6) is executed
The function vol(int a,int b,int c) will be called by passing the values as inputs.Then the function will returns 48 to the main function and prints it.
_____________________
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.