3.2 Programming Questions And
Answers
1.
Iteration b- bcorrect banswers✔✔repeating ba bsequence bof bcode buntil bthe bcondition
bbecomes binvalid
(FOR, bWHILE, bREPEAT-UNTIL, bDO-WHILE)
Selection b- bcorrect banswers✔✔choosing bwhich bpath ba bprogram bwill bfollow
(IF, bELSEIF, bELSE)
Why bdo bwe bneed b'meaningful bidentifier bnames'? b- bcorrect banswers✔✔The bname
bof bvariables, bconstants band bdata bstructures bMUST bbe blinked bto bits bpurpose bin
bthe bprogram
DIV b- bcorrect banswers✔✔Integer bDivision b(e.g. b9 bDIV b4 b= b2)
MOD b- bcorrect banswers✔✔Remainder bDivision b(e.g. b9 bMOD b4 b= b1)
Data bStructure b- bcorrect banswers✔✔an borganised bway bof bstoring bmultiple bdata
bwhich bis beasy bto bupdate/change
Subroutine b- bcorrect banswers✔✔a bnamed b'out bof bline' bblock bof bcode bwhich bcan
bbe bused bby bcalling bits bunique bname
Variable b- bcorrect banswers✔✔a btemporary bstorage blocation bwhich bcan bhold ba
bvalue b(that bcan bchange) bin ba bprogram
Why bdo bwe buse bSubroutines/Structured bapproach bwhen bprogramming? b- bcorrect
banswers✔✔Easier bto bupdate bcode b(without baffecting bWHOLE bPROGRAM)
Easier bto btest/debug bfor berrors
Easier bto bunderstand bthe bprogram
Easier bto bmaintain bthe bcode
Easier bto breuse bthe bsame bcode