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

structured prog ict mod 1

The document is an examination paper for the Diploma in Information Communication Technology at Machakos University, focusing on Structured Programming. It includes instructions for answering questions from two sections, covering topics such as programming techniques, C and Pascal programming, and program design. The exam consists of various questions requiring theoretical explanations, coding tasks, and flowchart designs.

Uploaded by

ephymannasse
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)
5 views4 pages

structured prog ict mod 1

The document is an examination paper for the Diploma in Information Communication Technology at Machakos University, focusing on Structured Programming. It includes instructions for answering questions from two sections, covering topics such as programming techniques, C and Pascal programming, and program design. The exam consists of various questions requiring theoretical explanations, coding tasks, and flowchart designs.

Uploaded by

ephymannasse
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/ 4

MACHAKOS UNIVERSITY

University Examinations for 2018/2019


SCHOOL OF ENGINEERING AND TECHNOLOGY
DEPARTMENT OF COMPUTING AND INFORMATION TECHNOLOGY
FIRST YEAR SECOND SEMESTER EXAMINATION FOR
DIPLOMA IN INFORMATION COMMUNICATION TECHNOLOGY
2920/103: STRUCTURED PROGRAMMING
DATE: 24/4/2019 TIME: 8.30-11.30 AM
INSTRUCTIONS

Answer five questions at least two from section one and at least two form section two

SECTION ONE
1 a) State the differences between the following terms.
i. Functional programming technique and event driven programming.
ii. Modularity and Structured theorem.
iii. High level languages and Low level languages. (12 marks)
b) Explain any three programming tools that can be used during program development
(6 marks)
c) Explain the meaning of the term data type as used in C programming. (2 marks)
2 a) Write a C program that will accept two values through the keyboard and calculate their
product. (6 marks)
b) Explain any three C programming variable Formatters. (6 marks)
c) Mary went through a program and met the & sign in the scanf statement. Explain to her
it’s purpose. (2 marks)
d) State the meaning of the following escape codes
i) \n.
ii) \t.
iii) \v.
iv) \a. (4 marks)
Examination Irregularity is punishable by expulsion Page 1 of 4
e) Identify the difference between the following expressions
i) =
== (2 marks)
3 a) Explain the meaning of the following terms as used in C programming
i. compiler
ii. Interpreter
iii. Executable code (6 marks)

b) Outline the methods of declaring a constant. (4 marks)


c) State the reasons why the following identifiers are invalid
i. value$sum
ii. exit flag
iii. 3lotsofmoney
iv. char (4 marks)
d) Explain any four factors one should consider before buying a programming Language
(4 marks)
e) Outline the two types of comments (2 marks)
4 a) Explain the top down and the bottom down approach . (4 marks)
b) Explain any four qualities of a good program. (4 marks)
c) Write a C program that accepts an integer number and calculates its square root
(4 marks)
d) Write a pseudo code for a program that will accept a value then display the value, and a
Message indicating whether the value is an even number or an odd number. (4 marks)
e) Write a C Program that will accept the radius of a circle and then calculate the area and
the perimeter of a circle. (4 marks)
SECTION TWO
5 a) Define the term identifier as used in programming. (2 marks)
b) Explain two advantages of modular programming. (4 marks)
c) A module I student intents to create a program that would accept the amount of money
spent in a supermarket in Kenya shillings. The program should then calculate the
equivalent of the amount in either dollars or pounds and out put the results.
i) Draw a flow chart to represent the program logic. (4 marks)

Examination Irregularity is punishable by expulsion Page 2 of 4


ii) Write a Pascal program to implement the design in (i). Use the rates: 1 dollar= Ksh 85
and 1 pound= Ksh 130. (6 marks)
d) Distinguish between or and not logical operators as used in Pascal programming.
(4 marks)
6. a) i) Outline two advantages of using an interpreter to translate a program.(2 marks)
ii) Explain two uses of comments in a Pascal program. (4 marks)
b) Write a Pascal program that accepts the total number of words in a book and the
number of words per page. The program then computes the number of pages and
displays the results. (6 marks)

c) Distinguish between simple and compound statements as used in Pascal programming.


(4 marks)
d) Explain each of the following terms as used in Pascal programming.
i) selection
ii) iteration. (4 marks)
7 a) Explain two advantages and two disadvantages of using a flowchart in program design.
(4 marks)
b) Study the following program and answer the questions that follow.
Program get area (input,output)
const rate := 0.1;
var 2salary, pension, integer;
writeln (Enter the basic salary of an employee);
read(Bsalary);
pension = rate*2salary,
Nsalary = 2salary + pension
writeln(===========================)
writeln(Your new salary is Nsalary)
end.
(i) Identify the errors in the program. (6 marks)
(ii) Rewrite the program correcting the errors identified in (i). (5 marks)
c) Write a program that could accept the name and age of a student. The program should
the output either “________You old enough to vote” if the age is greater than 18 years

Examination Irregularity is punishable by expulsion Page 3 of 4


or “ __________You can’t vote”) otherwise. The dashes should be filled with the name
of the student. (5 marks)
8 a) Outline four benefits of program documentation to the end user. (4 marks)
b) Table 1 shows the main menu of a management information system. Use it to answer
the question that follows.

Option Menu Activity


1 Capture a New Student
2 Edit Record
3 Check Balance
Close Record

Table 1

Write a Pascal program that would prompt a user to enter an option. The program then
outputs the menu activity. (6 marks)
c) Distinguish between program execution and deployment as used in programming.
(4 marks)
d) Explain three stages in program development. (6 marks)

Examination Irregularity is punishable by expulsion Page 4 of 4

You might also like