четверг, 25 февраля 2016 г.

CIS247 Final Exam


1. (TCO 1) Which of the following would be a more appropriate choice for a method in a PhoneCharger class? (Points : 5)
2. (TCO 1) Object-oriented programming generally focuses on _____. (Points : 5)
3. (TCO 2) Which of the following components of a class definition do not have an access modifier? (Points : 5)
4. (TCO 2) Which of the following statements is/are true? (Points : 5)
5. (TCO 5) Which of the following method pairs are not examples of method overloading? (Points : 5)
6. (TCO 1) Which of the following statements is/are false? (Points : 5)
7. (TCO 2) You have been tasked to create an Automobile class and your boss wants you to consider the concept of encapsulation as you design your class. Which of the following actions will you take? (Points : 5)
8. (TCO 2) A black box is a term used to describe a system that can be understood solely based on its inputs, a description of its _____ and the resulting outputs. (Points : 5)
9. (TCO 2) A class is designed with two public attributes: attributeOne and attributeTwo. attributeOne is an integer data type while attributeTwo is a string data type. Which pseudocode representation(s) of setters would be appropriate for this class? (Points : 5)
10. (TCO 7) How is the pure virtual function different from a regular function? (Points : 5)
11. (TCO 7) A(n) _____ cannot be instantiated and therefore is used only to form related derived classes. (Points : 5)
12. (TCO 7) In terms of object-oriented programming, rules for the use of an application programming interface or framework can be enforced through the use of a(n) _____. (Points : 5)
13. (TCO 4) If you have a complete, working Box class that has been thoroughly tested, and you wish to add an overloaded displayVolume() method that can display the location and volume of a GraphicBox, how should this be accomplished? (Points : 5)
14(TCO 3) An Order class and RushOrder class have what type of relationships? (Points : 5)
15(TCO 4) Why might it be better to create a derived class instead of adding a few lines of code to an existing Class? (Points : 5)
16. (TCO 4) Suppose class Child is derived from class Parent which in turn is derived from class GrandParent. When we destroy an object of class Child, three destructors are called: i) Child, ii) Parent, iii) GrandParent. What is the order? (Points : 5)
17. (TCO 6) The ability to reuse objects already defined, perhaps for a different purpose, with modification appropriate to the new purpose, is referred to as _____. (Points : 5)
18. (TCO 4) Which of the following is not a good example of a hierarchy that could be modeled with inheritance? (Points : 5)
19. (TCO 1) Examine the class definition. How many members does it contain?
20. (TCO 7) Which of the following declares a pure virtual function in an abstract C++ class? (Points : 5)
21. (TCO 4) Suppose that bClass is a class. Which of the following statements correctly derives the class dClass from bClass? (Points : 5)
22. (TCO 8) Data/information hiding and encapsulation improves construction and maintenance because: (Points : 5)
23. (TCO 8) What are some of the characteristics of a "good" comment? (Points : 5)
24. (TCO 9) The purpose of a namespace is to: (Points : 5)
ESSAY QUESTIONS
1. (TCO 8) Briefly describe which elements of a class use the Camel case, and what are the best practices regarding the naming of these elements. (Points : 18)
2. (TCO 2) Provide an example that shows how we can have Encapsulation without Data/Information Hiding in object-oriented programming. (Points : 18)
3. (TCO 2) Given the following program description,

• identify the required classes/objects necessary to achieve the program requirements;
• briefly describe any relationships that might exist between your classes; and
• briefly describe the overall hierarchy of your proposed classes.

Program Description - You have been asked to create a program designed to keep track of the inventory in a person's house. The program must keep track of all items owned by the house's resident and their specific location in the house. A single room can contain any number of items and every item should have a unique ID to differentiate it from all the other items. (Points : 18)
4. (TCO 7) How are pure virtual functions created? When a class contains one pure virtual function, what will happen? Can we still treat the class like a normal class? (Points : 18)
5. (TCO 4) Consider the class Bicycle. Given your knowledge of some common components of bicycles

• show a class hierarchy in which the class Bicycle inherits from other classes, which, in turn, can also be inherited from yet other classes;
• discuss inheritance from class Bicycle for other closely related derived classes; and
• discuss the common components of class Bicycle. (Points : 18)
6. (TCO 3) How does the "has-a" relationship relate to composition? Give an example of such a relationship. (Points : 18)
7. (TCO 2) Define and implement the overloaded constructors that support the following test function for a StudentEmployee class. The data members for the StudentEmployee class are:

Комментариев нет:

Отправить комментарий