Computer Science 2
Computer Science 2
136/2
Time: 3:00 Hours Date: Tuesday, 21st January 2025 p.m.
______________________________________________________________________________
Instructions
1. This paper consists of three (3) questions.
2. Answer Only two questions
3. Submit printed codes and screen shots together with softcopy of your work(s).
4. Save your work on the desktop in the folder named by your examination number.
5. Save your work by using the 2007 and above version of the MS Office software you are
m
using
co
6. Check whether the printed word (s) are similar to the softcopy saved in the folder.
7. Cellular phones and any unauthorized materials are not allowed in the examination room.
u.
lim
ae
az
w
Page 1 of 5
Form Six Pre – Mock Interschool Joint Exams 2025
1. (a) Write a c++ program to print squares, cubes, and square roots of integers from 1 to 20 using
mathematical functions. Run your program on the computer for the desired output.
(10 Marks)
(b) Write a c++ program to take an integer from the keyboard and give output of the sum of the
digits of the numbers (For, example, if the integer is 123 the output should be 1+2+3=6
(15 Marks)
2. (a) (i) Use visual basic to design the interface of the following snapshot.
m
co
u.
lim
ae
az
w
(ii) Use visual basic code to activate the above interface that allow user to enter the numeric values
for A,B and C then click one of three option buttons to display the result of an expression.
Format results of the first two expressions to two decimal places. (10 Marks)
Page 2 of 5
Form Six Pre – Mock Interschool Joint Exams 2025
(b) Design a simple calculator as shown on snap shot below that enable user to enter two numbers
and then clicks one of the four arithmetic operators to display the result. The whole calculation
is also displayed in the list box.
m
co
u.
lim
ae
Page 3 of 5
Form Six Pre – Mock Interschool Joint Exams 2025
3. (a) The Dean of students of Bunkhouse Academy has requested you to prepare the worksheet shown
below:
BROUKEHOUSE ACADEMY
m
co
u.
lim
ae
(i) Create a workbook Final Exam and enter the above data into a worksheet.
(ii) Centre the title across column, 18 points Georgia bold and apply grey shading to the totals
az
column
w
(iii) How much value can increase in cell “f7” (I mean 7 marks in theory) in order to reach total
value of 700 in cell in cell “f 17” as a total. Apply automatic advanced feature to do so, and
then print the desired result of worksheet obtained. (15 Marks)
Page 4 of 5
Form Six Pre – Mock Interschool Joint Exams 2025
(b) (i) Write html ancode to design the following web page below (10 marks)
m
(ii) Use JavaScript codes to activate the webpage in part (b)(i)If user enter correct password and
user name, form should display “validation is successful” if not form should display “validation is
co
fail”
· Hint: Use Hapatoshi as user name and your examination number as password.
u.
· Use green as background color
lim
Page 5 of 5
Form Six Pre – Mock Interschool Joint Exams 2025