For Smith_Comp

profile909kidd
essay_questions.docx

Essay Questions

Question 1.1. (TCO 1) Given the following array declaration and program statement, describe--in detail--the condition and what potential problems could occur if a program containing both was compiled and executed. int array[5][4] = {0}; array[4][4] = 5; (Points : 10)

             

Question 2.2. (TCO 2) Explain the basic C++ syntax for creating a class. Include an explanation of the private and public section of a class and the class members. Include a code segment to illustrate your answer. (Points : 10)

             

Question 3.3. (TCO 3) Write and explain the definition of what composition is and how it is useful in writing an object-oriented program. Also, explain how it is different from inheritance and how both inheritance and composition are useful in developing object-oriented programs. (Points : 10)

             

Question 4.4. (TCO 4) If a class is derived protected from a base class, explain how this affects the inheritance of all the public, protected, and private members of the base class by the derived class. (Points : 10)

             

Question 5.5. (TCO 5) When dynamically allocating memory for a specific data type, explain why a pointer variable of the same data type must be used. Describe what happens if the memory allocation is successful and what happens if it is unsuccessful. (Points : 10)

             

Question 6.6. (TCO 6) List and describe three restrictions regarding operator overloading. (Points : 10)

             

Question 7.7. (TCO 7) Define what is meant by the term run-time binding, and list two other terms that are also used to describe it. (Points : 10)

             

Question 8.8. (TCO 8) Describe and define what the preprocessor statement is, how it is used, what part of the development environment it interacts with, and provide a syntactically correct example that describes what it does. (Points : 10)