0% found this document useful (0 votes)
5 views4 pages

Programming Methodology 2

This document is an examination paper for the Programming Methodology course at Kampala University, detailing the structure and content of the exam. It includes instructions for the exam, a compulsory question, and a variety of topics covering C programming concepts such as keywords, operators, loops, and I/O functions. The exam consists of multiple questions that assess students' understanding of programming principles and their ability to write C code.

Uploaded by

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

Programming Methodology 2

This document is an examination paper for the Programming Methodology course at Kampala University, detailing the structure and content of the exam. It includes instructions for the exam, a compulsory question, and a variety of topics covering C programming concepts such as keywords, operators, loops, and I/O functions. The exam consists of multiple questions that assess students' understanding of programming principles and their ability to write C code.

Uploaded by

islandprincee1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Kampala University

UNIVERSITY EXAMINATIONS

END OF SEMESTER EXAMINATIONS

FEBRUARY- MAY, 2019

SCHOOL : COMPUTER SCIENCE AND INFORMATION TECH

PAPER : PROGRAMMING METHODOLOGY

CODE : BCIT 1202

DURATION : 3 HOURS

DATE : 8th/06/2019-MID-MORNING

INSTRUCTIONS

 DO NOT OPEN THIS QUESTION PAPER UNTIL YOU ARE TOLD TO DO SO.

 Attempt any five questions but Question One is Compulsory

 Each question carries 20 marks

 Do not write anything on the question paper.


QUESTION ONE

a) What are “Keywords” or “Reserve” words? Explain with examples (2 marks).


b) List and explain Five rules and naming conventions for identifiers in C language

(5 marks).
c) Why is Main() referred to as the driver function in C language?. Explain by show of a
simple program code (2 marks).
d) What is an escape sequence? Explain with a simple C program code (2 marks).
e) Explain the term Variable. How there declared and initialized? (2 marks).
f) Identify and explain any three operators used in C language. (3 marks).
g) Differentiate between an expression and a statement (2 marks).
h) What do you understand by the term “Unary” operator? Explain the different Unary
operators (2 marks).

QUESTION TWO

a) Write short notes on the history of C language (5 marks)


b) Discuss why is ‘C’ so popular? Write some features of C in support of your answer
(7 marks)
c) Describe the structure of C language (13 marks)

QUESTION THREE
a) Explain the following unformatted I/O library function with simple program codes
(4 marks @)
i. Getchar();
ii. Putchar();

iii. Gets();

iv. Puts();

v. Printf() and Scanf();


QUESTION THREE
a) Using a Unary operator, write a C program code to print out Integer values starting
from 1 to 20 with the while loop construct (5 marks)
b) Why is the While loop considered to be an Entry-controlled looping construct?
Explain your answer with an example (5 marks)
c) List and explain any Three Relational operators with an example (15 marks)

QUESTION FIVE

a) Write-down two different examples of each of the following: (2 marks @)


i. Programming statement
ii. One-dimension array
iii. Two-dimension array
iv. Function prototype
v. Function definition
b) Differentiate between a syntax and semantic with an example? (6 marks)
c) Define the term software bug as used in c programming. Explain your answer with
an example (6 marks)

QUESTION SIX
a) Given the following code below answer the questions that follow.

1. /* Program-2.2 - My First Program */


2. #include <stdio.h>
3. int main()
4. {
5. printf("Hello World!");
6. return 0;
7. }

i. Explain the above code from line 1 to 7 (15 marks)

b) If line statement 5 is altered to prinf("Hello World!"); what will be the output?(5mrks).


QUESTION SEVEN

Using the knowledge, you have gained in programming write a program which out puts
the following. (20 marks)

a) Menu
b) -----------------------------------
c) 1 – Microsoft Word
d) 2 – Yahoo messenger
e) 3 – AutoCAD
f) 4 – Java Games
g) -----------------------------------
h) Enter number of your preference:

You might also like