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

Bbit 121:Introduction To Programming 2Nd Trimester 2015 Question Paper

Bbit 121:Introduction To Programming 2Nd Trimester 2015 

Course:Bachelor Of Business Information Technology

Institution: Kenya Methodist University question papers

Exam Year:2015



Introduction to programming (BBIT 121) (CISY 110) (COMP 110) (BSIS 113) (MISC 43) 2ND TRIMESTER 2015
KENYA METHODIST UNIVERSITY

END OF 2nd TRIMESTER 2015 (PT) EXAMINATION

FACULTY : COMPUTING & INFORMATICS
DEPARTMENT : COMPUTER SCIENCE AND BUSINESS
INFORMATION
UNIT CODE : BBIT 121/CISY 110/COMP 110/BSIS113/MISC
431/DCIS 110/DBIT 121
UNIT TITLE : INTRODUCTION TO PROGRAMMING
TIME : 2 HOURS


INSTRUCTIONS:

Answer Question ONE and any Other TWO Questions

Question One (30 marks)
Define the following terms
Syntax
Algorithm
Escape sequence
Include directives
(4 marks)
Write a C++ program that determines if one is an adult or child using the if statement.
(3 marks)
Using the three loop statements, write C++ programs that count 1 to 10
(6 marks)
Describe the four steps that have to be followed when writing an iteration statement.
(4 marks)
Draw a complete (start-end) flowchart of the following nested loop statement
If (grade<0)

cout<< "NOT A VALID GRADE\n";

else if (grade <=39)

cout<< "FAIL\n";

else if (grade<=49)

cout <
else if (grade <=59)

cout << "Second Lower Division\n";

else if (grade <=69)

cout << "Second Upper Division\n";

else if (grade 101)

cout << "First Class Honours\n";

else cout << "GRADE OUT OF RANGE\n"; (6 marks)
What are the three qualities of a good algorithm
(3 marks)
Briefly explain the two most commonly used tools for designing program.
(4 marks)



Question Two (15 marks)
Define the term Array and briefly explain the two operations on an array.
(5 marks)
Write a two dimensional array (int two D [4] [5] that will generate the following output.
(10 marks)

0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19




Question Three (15 marks)
Write a C++ program that calculates the factorial of a value n
(10 marks)
Explain five reasons for using functions in C++ programming.
(5 marks)



Question Four (15 marks)
Using switch and if …. else statements, write the two grading programs. Consider the following grading system;
70-100 First Class Honors

60-69 Second Upper Division

50-59 Second Lower Division

40-49 Pass

0-39 Fail (10 marks)
Using the break statement write a program that computes the sum of a set of negative numbers and the break statement should exit the loop when it encounters a positive number.
(5 marks)






More Question Papers


Popular Exams



Return to Question Papers