Get premium membership and access revision papers, questions with answers as well as video lessons.

Introduction To Programming(Dcis 110) (Dbit 121) Question Paper

Introduction To Programming(Dcis 110) (Dbit 121) 

Course:Computer Science And Business

Institution: Kenya Methodist University question papers

Exam Year:2012



TIME : 2 HOURS

Instructions:
Answer question one and any other two questions.
Question One
Why is the main function special in C++
(1mk)
What are the major, differences between object oriented programming and procedural programming.
(4mks)
Problem definition is the first step in the problem solving process. It enables the programmer to clearly identify the problem to be solved, before proposing a solution. State the four steps in problem definition. (4mks)
Write a C++ program that prints "Hello world! I’m a C++ program" on the screen.
(3mks)
i) What is available?
(2mks)
ii) Describe how do you declare available in C++. (2mks)
Define an array and use an example to illustrate how an array is declared and initialized in C++. (4mks)
What is the output of the following code?
(2mks)
Char symbol [3] = {’a’, ’b’, ’c’}
for (int index = 0, index <3, index ++)
cout << symbol [index]
i) Program execution may be sequential, conditional or iterative. Briefly explain this statement.
(6mks)
ii) What is a pointer? (2mks)

Question Two
Define an array and use an example to illustrate how an array is declared and initialized in C++.
(5mks)
Using a flowchart, distinguish between the while – loop and the do while loop structures.
(6mks)
With the help of an appropriate example, describe the general structure of a four loop in C++.
(4mks)

Question Three
List three application area of OOP.
(3mks)
What is recursion?
(2mks)
Write a program that calculates the area of a square in C++.
(5mks)
Explain any classifications of programming languages.
(3mks)
Differentiate between I ++ and ++I.
(2mks)

Question Four
You would wish to come up with a program that determines the largest of three numbers.
Write an algorithm that would be used to solve the problems. (5mks)
Draw a flow chart representation of your algorithm. (5mks)
Write a C++ program to solve the problem. (5mks)






More Question Papers


Popular Exams


Mid Term Exams

End Term 1 Exams

End Term 3 Exams

Opener Exams

Full Set Exams



Return to Question Papers