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 2016

Write a C++ program that will Write characters to a file until the user enters 'S' to stop

    Viewed:  238  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. Explain the way in which object oriented programming supports each of the following reasoning: (4 marks) I.Induction; II.Deductive.
2. Outline three typical steps object oriented programming
3. Distinguish between selector and setter operations as used in OOP
4. Define the term abstraction as used in OOP
5. Peter a module Il student is convicted that struct is an abstract data type. Explain four reasons to justify Peter's position
6. Outline four reasons why OOP is popular in software development
7. Describe dynamic binding as used in OOP
8. Distinguish state and behavior of an object as used in OOP
9. Study the following C++ program segment and answer the questions that follow. (i) Identify two errors in the program providing a possible solution in each case, (ii) Explain the implementation of using each of the access specifier in the program. (iii) Interpret the 4th line in the program segment.
10. Evaluate each of the following C++ statements (showing your working) (i) B=12+4-7*9%6+12/3 (ii) 13-(8%5)>-9%7-3+6*2
11. Write a C++ program that accepts the radius of a circle and uses an inline function to determine the area of circle. The program should output the area of the circle.
12. Describe the circumstance under which the following varieties of classes are used in OOP: I.Data managers II.Data source/sink
13. Write a C+ program that accepts dimensions of a rectangle and a rhombus. The program should then use an overloaded function named area to determine area or the respective figures. Output the dimensions and areas of the figures
14. Explain the term recursive as used in programming
15. Distinguish between value and variable parameter as used with functions during C++ program writing
16. List four rules that are applicable when using constructors in C++ programs
17. Write C++ program that will implement class named arithmetic with three integers initialized as 5,7 and 10 respectively and member function used to determine and output the product integers. Use a parameterized constructor
18. )Interpret the following C++ program segment; (5 marks)
#include<iostream>
using namespace std;
class myclass
{
int a;
public:
myclass() (a-120;)
intget();
};
int my class:: get() {return a;}
int main() {
myclass ob;
myclass *p;
p=&ob;
cout<< “the output using pointers: get();
return 0;
}

19. State two ways of using references in C++ programs
20. Distinguish between a friend function and function prototype as used in C++ programs
21. Explain three benefits of inheritance as applied in OOP
22. Helen would like to implement operator overloading in her system project. Outline two restrictions associated with operator overloading that she should consider.
23. Write a C++ program that will implement a class named with following properties: (6 marks) • data members as x and y; • a constructor for initializing the matrix elements (x =3 and y = 4); • a member function for displaying the matrix element • an overloaded operator function for determining the product of the matrix with a scalar that is input in The main function. Note: The program should
24. Explain the following forms of inheritance as used in OOP; (2 marks) I. extension II. Limitation
25. Describe the circumstance under which each of the following concepts are most applicable in OOP: I. abstract class; II. Virtual function.
26. Copy constructors are only used for initialization in OOP. Describe three occurrences of initialization where they are applicable.
27. Write a C++ program that will Write characters to a file until the user enters 'S' to stop
28. Outline four disadvantages of implementing Inheritance in C++ programs
29. Distinguish between coupling and cohesion as used in OOP
30. Explain the term destructor used in C++ programs
31. Write a C++ program that will carry out the following: (10 marks) • define a class named circular that has data members named radius and height, a member function named set which is used to initialize the value of length and height and a virtual function named volume; • implements a derived class from circular named cylinder whose radius and height • implements a derived class from circular
32. Explain two reasons for using I/O files in OOP
33. Distinguish between overloading unary operators using member functions and using friend functions
34. The module III candidates have been advised to use OOP in their projects. Explain two measures that they should put in place in order to cope the challenges in OOP
35. Write a C++ program that uses an array of objects to generate the following . Use for loop. 1 2 3 4 5 6 7 8


About Us

Contact us

Terms of use | Privacy policy

Follow Us:               

All Rights Reserved © 2024; pscustudies.com