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

Coe 301: Introduction To Programming Question Paper

Coe 301: Introduction To Programming 

Course:Bachelor Of Engineering In Electrical And Electronics Engineering

Institution: Moi University question papers

Exam Year:2011



MOI UNIVERSITY
UNIVERSITY EXAMINATIONS
2011/2012 ACADEMIC YEAR

THIRD YEAR FIRST SEMESTER EXAMINATIONS
FOR THE DEGREE OF BACHELOR OF ENGINEERING IN ELECTRICAL AND COMPUTER ENGINEERING

COURSE CODE: COE 301
COURSE TITLE: INTRODUCTION TO PROGRAMMING

INSTRUCTIONS TO CANDIDATES; ANSWER ANY FIVE QUESTIONS

QUESTION ONE
a. Discuss the factors to be considered before acquiring a software. (5mks)

b. An organization wishes to develop a software. Discuss the steps that should be followed in developing the software. (5mks)

c. Explain the various types of tokens in C++ programming. (4mks)

QUESTION TWO
a. C++ is rich with data types. Explain the statement giving examples. (4mks)

b. Distinguish between statements and expressions; hence discuss the rules that must be followed when defining variables in a program. (5mks)

c. Write a C++ program to find the least of the three input numbers. (5mks)

QUESTION THREE
a. Discuss the importance of functions in a program. (2mks)

b. A program is required to find the sum of the digits in a number e.g 23456, write a function oriented program to implement the process. (6mks)

c. With the help of an example that swaps three elements, explain the concept of pass by reference. (6mks)

QUESTION FOUR
a. Discuss by use of an example how conditional operators are useful in programming. (3mks)

b. While writing and compiling a program, it is possible that mistakes are made. Discuss the possible types of errors if the following events are encountered:

i. Division by zero
ii. Endless loop
iii. Using undeclared variables
iv. Using wrong formula
v. Missing semi colons (5mks)

c. Admission to a professional course is subject to the following conditions:

Marks in Mathematics >=60
Marks in Physics >=50
Marks in Chemistry >=40
Total marks in all the three subjects >=200
or
Total in Mathematics and Physics >=150

Given the marks in the three subjects, write a program to process the applications to list the eligible candidates. (6mks)

QUESTION FIVE
a. Distinguish between branching and loosing. (2mks)

b. With the help of syntax and a flowchart explain the following control structurers:

i. for ... loop control structure
ii. continue control structure (6mks)

c. Using do ... while loop control structure write a program to find the sum of odd numbers between 33 and 89. (6mks)

QUESTION SIX
a. Discuss the following programming terms:

i. Class and object
ii. Data abstraction and encapsulation. (4mks)

b. Discuss the various types of inheritance available in C++ programming. (6mks)

c. Write a class oriented program to compute the compound interest for the sum invested for n years. (4mks)

QUESTION SEVEN
a. Discuss how sorting and searching can be achieved: hence draw a flowchart and write a corresponding program to sort and search the elements in the array. (14mks)






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