Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

W1-2-60-1-6

JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY

BIT 2118: APPLICATION PROGRAMMING I - TAKE-AWAY CAT

Instructions: Answer the TWO questions and submit your solutions to Nathan, who will in turn
forward them to me via my email address (bmkyenge@yahoo.com), tomorrow by 11.00am
latest.

Question 1
(a) A program is required to capture three numbers, compare them and display the largest of
the three. (NB: the numbers could be equal).
(i) Draw the flowchart diagram.
(ii) Write the program.
(b) Write a program to capture two numbers then compute and display the:
(i) square root of the first number to 2 decimal points.
(ii) result of the first number raised to the power of the second.
Question 2
(a) Identify an example of an application area where a multi-dimensional array may be
preferred to a 1-D array. Justify your answer.
(b) Write a program that uses a 2-D array to generate an addition table of numbers in the
format shown below. The output should be printed on a picture box control.

1 2 3 ….
1 2 3 4 ….
2 3 4 5 ….
3 4 5 6 ….
. . . . ….
. . . .

You might also like