Click to follow our Afritutor YouTube Channel, subscribe and click notifications and get updates on new learning videos


<=Back

<=KNEC Diploma in ICT module II Object Oriented Programming past paper: March 2024

Figure 1 represents the relationship among classes (class name is bolded). Use it to answer the question that follows.
OOP-march-2024-003.JPG
Write a C++ program that would implement the form of inheritance, the base would
allow the user to key in and the derived class would determine and output the amount
(salary + bonus) using a member function.

    Viewed:  123  times
For Better experience and learning,for video answers, after video ends playing, click next question in the questions list!!!

  Share in:
        

Question Answer:





Questions List:

1. Outline three reasons for using friend functions in OOP programs
2. Explain two typical characteristics of object-oriented programs
3. Differentiate between signed and unsigned integers as used in C++
4. Explain two circumstances that would necessitate the use of static data member in C++ programs.
5. Write a C++ program to implement a class named Circle which has one data member and method named getData for input. Further the class has a friend class named Area with has a method named getArea to determine the area of a circle. The main function display the area of the circle .
6. ) Outline the function of each of the following punctuactors as used in C++ programs (i) % (ii) () (iii) ::
7. Explain two uses of Void data type in C++ programs
8. Describe two circumstances that would necessitate the use abstract classes in programs
9. Write a C++ program segment that will read a file named Access.doc.
10. Write a C++ program to implement a class named Cylinder that has a parameterized constructor used to assign the dimensions (length(21), radius(7)) and a member function named CVolume used to determine and display the volume of a Cylinder. Hint: #V=πr^2h#
11. Outline three benefits of using structures in OOP
12. Explain two challenges for copying with emerging trends with OOP
13. Differentiate between procedural and object oriented programming languages
14. Students were requested to write a program in C++ to implement the concept of encapsulation. Outline three strengths of such a program
15. Write a C++ program that implements a class named Data contains a structure named enter with variables Surname and age. The main function will allow a user to input and display the keyed in information in the structure
16. Outline four rules while defining virtual functions in OOP
17. Differentiate between Null pointer and Void pointer as used in C++ programs
18. A lecturer wrote the following program on the white board. Identify eight such errors.
19. The following values represent a display from a matrix. Use it to answer the question that follows. Write a C++ program to implement a class named Array with a variable initialized the values and has a method called ShowArray to display the values of the matrix as they appears.
20. Outline four advantages of an inline function
21. Differentiate between message passing and method call as used in C++
22. Write a C++ program to implement a class name Mother that has a method named inside (defined within the class) to display the message "Source of life" and another in method named Son (define outside the class) to display the message "A blessing from our maker". )
23. Write a C++ program to implement a class named Vehicle with three data members' brand, model and year and a constructor for initialization of the data members to display the following in the main program. (BMW, X5, 2000) (Ford, Mustang, 1970)
24. Outline the function of each of the following file opening modes. (i) ios::app (ii) ios::ate (iii) ios::trunk
25. Explain two types of header files used in C++ programs
26. Write a C++ program that will initialize a trapezium object with the dimensions 28, 16 and 18 for x, y and height respectively. The program should then determine the area of the trapezium through the use of a friend function and then output the area of the trapezium.
27. Write a C++ program that would allow a user to read from a text file named exam.txt and output the statement "Unable to open file" if the file is not found
28. Explain two uses of destructors in OOP.
29. Differentiate between multiple and multilevel inheritance as applied in OOP
30. Explain two circumstances that would lead to the change of an OOP compiler in an organization.
31. Write a C++ program to determine and output the area of a Tria (with 12 and 8 as the base and height respectively) and Rect (with also 12 and 8 as the base (length) and height (width) respectively). The program should use a virtual base class named- Shapes, polymorphic function named Area and appropriate pointers
32. Outline four guidelines used when overloading operators in C++.
33. Differentiate between operator new and operator delete in operator overloading
34. Figure 1 represents the relationship among classes (class name is bolded). Use it to answer the question that follows. Write a C++ program that would implement the form of inheritance, the base would allow the user to key in and the derived class would determine and output the amount (salary + bonus) using a member function.
35. The following is a C++ program segment written by a lecturer on a white board. Use it to answer the question that follows.


About Us

Contact us

Terms of use | Privacy policy

Follow Us:               

All Rights Reserved © 2024; pscustudies.com