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

Sit 106 Programming Methodology

This document outlines the examination structure for the Bachelor of Science in Information Technology at Machakos University for the course SIT 106: Programming Methodology. It includes instructions for answering questions, a breakdown of topics such as identifiers, variables, loop control structures, decision-making control structures, and programming concepts like structs and classes. The exam consists of five questions, with specific marks allocated to each section.

Uploaded by

festusedison94
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)
42 views3 pages

Sit 106 Programming Methodology

This document outlines the examination structure for the Bachelor of Science in Information Technology at Machakos University for the course SIT 106: Programming Methodology. It includes instructions for answering questions, a breakdown of topics such as identifiers, variables, loop control structures, decision-making control structures, and programming concepts like structs and classes. The exam consists of five questions, with specific marks allocated to each section.

Uploaded by

festusedison94
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 SPECIAL/SUPPLEMENTARY EXAMINATION FOR
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SIT 106: PROGRAMMING METHODOLOGY
DATE: 22/7/2019 TIME: 2.00-4.00 PM
INSTRUCTIONS
Answer question ONE and any other TWO questions.

QUESTION ONE (30 MARKS, COMPULSORY)


a) Define the following
i. Identifier (2 marks)
ii. Variable (2 marks)
b) What rules are used in creating an identifier? (5 marks)
c) Give TWO examples for each of the following:
i. Data type (2 marks)
ii. Editor (2 marks)
iii. Compiler (2 marks)
d) Give TWO reasons why we declare variables in a program (4 marks)
e) Convert the following expressions into programming statements

i) xn (2 marks)

ii) m n− x (2 marks)
f) Describe the steps involved in programming (7 marks)

Examination Irregularity is punishable by expulsion Page 1 of 3


QUESTION TWO (20 MARKS)
a) Describe the loop control structure (8 marks)
b) Study the program below and answer the questions below
#include <iostream>
using namespace std;
int main()
{
int j;
for(j=0; j<15; j++)
cout << j * j << “ “;
cout << endl;
return 0;
}
i. What is the output of the program (3 marks)
ii. Rewrite the program using the do..while statement (4 marks)
iii. Draw a flow chart to represent the program above (5 marks)

QUESTION THREE (20 MARKS)


a) Describe Decision Making Control Structure (8 marks)
b) Given the following code fragment:
i. float p = 1.0; int n = 7; int x=2;
ii. for (int i=1; i<=n; i++) { if (n%2 == 1) p = p * x; cout << p << endl;}
c) What is the output of the program? (4 marks)
d) Express the output in terms of x (3 marks)
e) Draw a flow diagram to represent these structure (5 marks)

QUESTION FOUR (20 MARKS)


a) Using an example in each case explain the following terms as used in programming
i) Call-by-value (5 marks)
ii) Call-by-reference (5 marks)
b) Convert the following expressions to a programming statement:

i) mn + ex (5 marks)
ii) (5 marks)

Examination Irregularity is punishable by expulsion Page 2 of 3


QUESTION FIVE (20 MARKS)
a) Using an example explain the difference between a struct and a class (5 marks)
b) Write a function that can be used to find the greatest number among THREE floating
point numbers (6 marks)
c) Using examples of your choice explain what you understand by the following
i. method overloading (3 marks)
ii. accessor method (3 marks)
iii. mutator method (3 marks)

Examination Irregularity is punishable by expulsion Page 3 of 3

You might also like