QUESTION 8 What are some reasons for defining functions? a. Allow modular progra
ID: 3717814 • Letter: Q
Question
QUESTION 8 What are some reasons for defining functions? a. Allow modular program development D. Improve program redability C.All are valid reasons d. Avoid writing redundant code QUESTION 9 What is the difference between a public and private method in a class? a. A public method can be called by any other part of your program. A private method can only be called within the context of the object. D. There is no real difference both are semantically equivalent C. A private method can be called by any other part of your program. A public method can only be called within the context of the object. d.C++ does not have public and private methods only C has those things.Explanation / Answer
Question 8
Answer is C. All are valid reasons.
Function allows modular programming,improved readability and avoids redundant codes.
Question 9
Answer is 'a'.
If we declare a function as public it can be called from any other part of the program. If function is declared as private it can be called only with in the context of the object.
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.