Sie sind auf Seite 1von 5

BFEC SECONDARY DIVISION FORM 5 INFORMATION

TECHNOLOGY
PROGRAMMING ASSESSMENT
Name:________________________ Form: ____________
Score:___________
SECTION I: Mul!"le C#o!ce
Each item in this test has four suggested answers lettered a, b, c, d. Read each item
and decide which choice is best. $% Mar&'(
1. Given the algorithm
j = 5
k = j
j = j + k
k = j +
)!'"la* k
the value dis!la"ed for & is
a# 1$
b# 11
c# 1
d# 1%
&. 'hich of the following identifiers is ()* a valid variable name
a# cost+in!ut
b# total,ost
c# -,ount
d# (um,ount
. ./.n +++++++++++++++++++++++++++ is a set of ste!0b"0ste! instruction given to solve
a !roblem. 1t can be described in man" wa"s.
a# 2inar" code
b# .lgorithm
c# 3igh level language
d# Reci!e
%. .n 1n!ut04rocessing0)ut!ut 514)# chart should be !roduced+++++++++++++.
a# before the algorithm is written
b# after the !seudocode is written
c# after the flowchart is drawn
d# before the !roblem is identified
5. 6te!s in !roblem solving involve the following e+ce"
TOTAL , -5 POINTS
BFEC SECONDARY DIVISION FORM 5 INFORMATION
TECHNOLOGY
PROGRAMMING ASSESSMENT
a# 7efining the !roblem
b# *esting the algorithm
c# 7ocumenting the !rogram
d# ,alculating the average
8. 'hich of the following algorithms satisfies the re9uirement of asking the user to
in!ut two numbers, calculating the average and dis!la"ing the result:
5a# dis!la" ;Enter two numbers<
rea) a, b
c = 5a+b#/&
)!'"la* c
5b# !."u a, b
c = 5a+b#/&
)!'"la* c
5c# dis!la" ;Enter two numbers<
rea) a, b
c = a+b/&
)!'"la* c
5b# !."u a, b
c = a+b/&
)!'"la* c
=. *he variables h and s are assigned the following values, # = % and ' = > h.
7is!la" h + s > & will show
5a# &?
5b# $
5c# &
5d# ?
?. *he term used to describe a memor" location whose value changes during
!rogram e@ecution is
5a# constant
5b# volatile
5c# variable
5d# d"namic
Sec!o. II A.'/er All 0ue'!o.'
1. .rrange the labels to show the correc order in which the ste!s in !roblem
solving occur. 'rite that order belowA0 $5 Mar&'(
TOTAL , -5 POINTS
BFEC SECONDARY DIVISION FORM 5 INFORMATION
TECHNOLOGY
PROGRAMMING ASSESSMENT
Babels 6tatements
61 6elect the most efficient solution
6& *est and validate the solution
6 7efinition of the !roblem
6% 7evelo! the algorithm
65 4ro!ose and evaluate solutions
S1 De2!.!!o. o2 #e "ro3lem
S4 Selec #e mo' e22!c!e. 'olu!o.
S- De5elo" #e al6or!#m
S7 Te' a.) 5al!)ae #e 'olu!o.
S5 Pro"o'e a.) e5aluae 'olu!o.'
&. 6tate what each of the following o!erators meansA $7 Mar&'(
a. C= 6reaer #a. or e8ual o
b. = e8ual o
c. D= le'' #a. or e8ual o
d. D C No e8ual o
. 'rite an algorithm that would read two numbersE find the average of the numbers
and !rint the results. 5 mar&'
a9 READ A: B
39 AVERAGE:; A<B=4
TOTAL , -5 POINTS
BFEC SECONDARY DIVISION FORM 5 INFORMATION
TECHNOLOGY
PROGRAMMING ASSESSMENT
c9 PRINT AVERAGE
%. 'rite one algorithm using !seudocode to do the following se9uence of tasksA
a. Read in the two valuesE 1 mar&
b. Find the !roduct of the valuesE 1 mar&
c. Gulti!l" both values b" the number 1$ and add the resultsE 4 mar&'
d. 69uare both valuesE 1 mar&
e. Find the sum of the s9uaresE and 1 mar&
f. 4rint the !roduct and sum of the s9uares. 4 mar&'
a9 READ A: B 1 MAR>
39 PRO ; A ? B 1 MAR>
c9 V1 ; A?1@ 1 MAR>
V4 ; B ? 1@ 1 MAR>
RES ; V1 < V4 1 MAR>
)9 S0 ; A ? A 1 MAR>
S01 ; B ? B 1 MAR>
e9 SS ; S0 < S01 1 MAR>
29 PRINT PRO: SS 1 MAR>
5. 'rite an algorithm that would !rom!t the user to in!ut in the values of THREE
variables, ., 2 and ,. *he algorithm should add the variables . and ,E subtract 2 from
the resultsE and !rint the answer. $5 mar&'(
PRINT AENTER THREE NBMBERSC 1 MAR>
INPBT A: B: C 1 MAR>
RES ; A < C 1 MAR>
ANS ; RES D B 1 MAR>
PRINT ANS 1 MAR>
TOTAL , -5 POINTS
BFEC SECONDARY DIVISION FORM 5 INFORMATION
TECHNOLOGY
PROGRAMMING ASSESSMENT
TOTAL , -5 POINTS