1. You are a manager who is employed by a game production company. Your team is responsible for coding one of the game modules. You have two newly hired programmers working for you who believe that following naming conventions and properly chosen names for methods is too restrictive since each person has his own style and it should be skipped. How would you explain to them what the best practices for naming methods is and why it is so necessary? 

 

2. (TCO 2) Provide an example that shows how we can have Encapsulation without Data/Information Hiding in object-oriented programming. 

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 take coffee orders in a coffee shop. The program must be able to take an order, assign a unique ID to the order, add any number of drinks to the order, and calculate the total bill.

4. (TCO 7) How do you distinguish between virtual functions and pure virtual functions? How do you use the abstract class and the methods defined inside the abstract class? (Points : 18)

5. (TCO 4) Consider the class Employee. Given your knowledge of some common components of employees

• show a class hierarchy in which the class Employee inherits from other classes, which, in turn, can also be inherited from yet other classes;
• discuss inheritance from class Employee for other closely related derived classes; and
• discuss the common components of class Employee.


6. (TCO 3) How does the "is-a" relationship relate to inheritance? Give an example of such a relationship

7. (TCO 2) Define and implement the overloaded constructors that support the following test function for a Student class. The data members for the Student class are:

• age - integer number
• name - string
• DSI - string

int main()
{ Student s1(); //s1 will take all default values
Student s2(23, "Student Joe", "D12345678"); //s2 will take all supplied values
Student s3(25); //s3 will take supplied age, name and DSI will take default values
Student s4(28, "James Bond"); // s4 will take supplied age and name, DSI will take default value
Student s5=s2; //s5 will take the same value as s2

//the rest of the code
}

 

 

    • 11 years ago
    A+ Answers
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      kghb4.docx