0% found this document useful (0 votes)
8 views3 pages

Sit 106 Programming Methodology 3

This document outlines the examination structure for the Bachelor of Science in Information Technology at Machakos University, specifically for the Programming Methodology course. It includes instructions for answering questions, a compulsory question with multiple parts, and additional questions covering topics such as system software, data types, programming functions, and control structures. The exam assesses students' understanding of programming concepts and their ability to apply them in practical scenarios.

Uploaded by

kengashkg7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Sit 106 Programming Methodology 3

This document outlines the examination structure for the Bachelor of Science in Information Technology at Machakos University, specifically for the Programming Methodology course. It includes instructions for answering questions, a compulsory question with multiple parts, and additional questions covering topics such as system software, data types, programming functions, and control structures. The exam assesses students' understanding of programming concepts and their ability to apply them in practical scenarios.

Uploaded by

kengashkg7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

MACHAKOS UNIVERSITY

University Examinations for 2018/2019


SCHOOL OF ENGINEERING AND TECHNOLOGY
DEPARTMENT OF COMPUTING AND INFORMATION TECHNOLOGY
FIRST YEAR SUPPLIMENTARY EXAMINATION FOR
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SIT 106: PROGRAMMING METHODOLOGY
DATE: TIME:
INSTRUCTIONS
i) Answer question ONE and any other TWO questions
ii) Write on both sides of the answer sheet

QUESTION ONE (COMPULSORY)(30 MARKS)


a) Show how to declare the following in a program
i) Income of an employee. (2 marks)
ii) Name of a politician (1 mark)
iii) Number of words in a dictionary. (1 mark)
iv) Daily collection of rainfall data in millimetres for the whole month. (2 mark)
v) A collection of mixed simple data types (2 mark)
b) Explain the use of the following in computer programming:
i) Compiler (1 marks)
ii) Debugger (1 marks)
iii) Assembler (1 marks)
iv) Algorithm (2 marks)
c) What is the significance of a large memory size in a computer (3 marks)
d) Describe the programming process (3 marks)
e) Write a programming statement to represent the following narrative: Compute and
print the weekly pay for a worker. All workers are paid an hourly rate and salary is
based on hours times rate. Any work done in excess of 40 hours, is paid at 1.5 times

Examination Irregularity is punishable by expulsion Page 1 of 3


the normal rate.
(5 marks)
f) Convert the following expressions to a programming statement:

vi) x 2 + y2 (2 marks)

vii) e x + m n (2 marks)

viii) ( x 2  4ac ) / 2a (2 marks)


QUESTION TWO (20 MARKS)

a) Give two examples of system software and explain their use (4 marks)
b) Using a diagram explain the Von Neumann architecture of a computer system (6 marks)
c) Consider the following programming statements.
int x = 2, n = 6, p = 1;
for (int i = 1; i <= n; ++i){
p = p * x;
cout << p << endl;}}
i) What is the output value? (3 mark)
ii) Express the output value as a function of x (2 marks)
iii) Draw a flow chart diagram to represent the program above (5 marks)

QUESTION THREE (20 MARKS)

a) What is the importance of data types in programming (3 marks)


b) Distinguish between simple and structured data types(use examples to show how they
are used in programming) (5 marks)
c)
d) Given a quadratic equation of the form 𝑎𝑥 2 + bx + c = 0 where a>=0 draw a flow-
chart for the solution of the equation (6 marks)
e) Use any three programming statements to describe decision making in programming
(6 marks)
QUESTION FOUR (20 MARKS)
a) What is a function in computer programming (1 mark)
b) Write a function/method to find the greatest among two integers (4 marks)
c) Create a program that receives two integers from the keyboard and uses the
function/method to display the greatest number (5 marks)

Examination Irregularity is punishable by expulsion Page 2 of 3


f) Given the following program code:
float p = 1.0; int n = 33; int x=2;

for (int i=1; i<=n; i++) {

if (n%2 == 1) p = p * x;

cout << p << endl;}

i) What kind of a control structure is it? (1 mark)


ii) Rewrite the above code using a while…statement (4 marks)
iii) Draw a flow diagram to represent these structure (5 marks)

QUESTION FIVE (20 MARKS)

a) Use the table below to construct a nested if statement to print the string of characters
given the conditions (6 marks)
P>=Q P<Q

X>Y Cow Goat

X<=Y Donkey Horse

b) Using examples, explain the main principles of object oriented programming


(8 marks)
c) Compare object oriented programming to structural programming techniques
(6 marks)

Examination Irregularity is punishable by expulsion Page 3 of 3

You might also like