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: November 2018

Distinguish between a destructor and an explicit constructor

    Viewed:  254  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 differences between object Oriented paradigm procedural programing paradigm
2. Describe an identifier citing the rules followed to create it in C++ programming language
3. Distinguish between state and behavior of an object as used in Object Oriented Programming
4. Write a C++ program that prompts the user to enter an integer x from the keyboard and display the results when the integer is multiplied by 2. The output should display the following on the screen. (6 marks). Output: Please enter an integer value: _ Value you entered is _ and its results is_
5. Table 1 shows C++ programming language escape sequence. State the purpose of each
6. Explain each of the following data types as used in C++ programming language: (6 marks) (i) typedef; (ii) enumerated data type; (iii) Reference.
7. Outline the role of each of the following keywords in a switch control structure: (4 marks) (i) break; (ii) Default;
8. With the aid of syntax code, explain each of the following as used in C++ programming.(8 marks) (i) namespace; (ii) pure virtual functions;
9. State four characteristics of a C++ static function
10. With the aid of a syntax code, explain the C++ goto control structure
11. Distinguish between the following pairs of the pointer function in C++; (4 marks) (i) seekg and seekp (ii) tellg and tellp;
12. A C++ class defined with the following code: class PUBLISHER { char Pub[12]; double Turnover; protected: void Register(); public: PUBLISHER(); void Enter(); void Display(); }; class BRANCH { char CITY[20]; protected: float Employees; public:BRANCH(); void Haveit(); void Giveit(); }; class AUTHOR:private BRANCH,public PUBLISHER { int Acode; char Aname[20]; float Amount; public:AUTHOR
13. State four areas where array datatype may be used
14. Table 2 shows a C++ program code segment. Identify four errors in the code
15. Write a C++ program function that inserts an element at a desired point in an array B
16. Given an array A[6][16] whose base address is 100. Determine the location A[2][5] if each elements occupies 4 bytes and the array is stored row wise
17. Outline two rules followed when inheriting constructors
18. State four characteristics of the friend function
19. Explain the role of mutable class member in C++ programming
20. Distinguish between ISA and HASA class relationships
21. Figure 1 shows a representation of a type of inheritance btween as base class A,B and a derived class C (I) Identify the type of inheritance (II) Write a C++ syntax code to implement the inheritance
22. Describe a constructor as used in C++ programming
23. State two ways of calling a constructor in a C++ program
24. Explain abstraction as used in object oriented programming
25. Distinguish between a destructor and an explicit constructor
26. Rewrite the corrected code for the following C++ structure element. (8 marks) #include structure Supergym { Int member number; char membername[20]; Char membertype[]= “HIG”; }; void main() { Supergym persona1,person2; Cin << “Member Number:” ; cin<>person1.membername; person1.member type= “MIG”; person2=person1; cin<< “Member Numb
27. State two charactristics of C++ variables
28. Differentiate between method overloading and method overridding
29. Explain each of the following as used in polymorphism: (i) late binding; (ii) Function hiding
30. Champo a second year diploma student has been given the following tasks: • Create an abstract class called shape which contains a pure virtual function called find_vol() and a protected attribute named as volume; • Create two new derived classes from the above class named as cube and sphere having double type attribute named as side and radius respectively; • Implement dynamic polymorphism to find
31. Outline the function of each of the following as used in C++; (4 marks) (i) ifstream; (ii) ofstream
32. Table 3 shows string functions in C++. Outline the purpose of each function. (3 marks) Strcat(S1,S2) Strcpy(S1,S2) Strupr(s)
33. Write a C++ function to count the number of words in a text file named “OUT.TXT”.
34. A C++ program segment is represented as follows: int c,d;cin>>c; d=(c<10)?-1:((c>10)?1:0); cout<


About Us

Contact us

Terms of use | Privacy policy

Follow Us:               

All Rights Reserved © 2024; pscustudies.com