question archive (a) What is the difference between looping and selection? (2 marks) ______________________________________________________________________ ______________________________________________________________________ (b) Name the stage of program development cycle when: (3 marks) (i) A user guide would be written
Subject:Computer SciencePrice: Bought3
(a) What is the difference between looping and selection? (2 marks)
______________________________________________________________________
______________________________________________________________________
(b) Name the stage of program development cycle when: (3 marks)
(i) A user guide would be written.
______________________________________________________________________
A programmer dry-runs the code.
______________________________________________________________________
System charts would be drawn.
______________________________________________________________________
(c) Study the pseudo-code below and answer the questions that follow.
The pseudo code is as follows
BEGIN
Print "enter the value of M and N";
Read M,N
Set χ = M;
Set y = N;
P = y - χ;
Q = χ - y;
IF P >Q THEN;
Set P = χ;
Set Q = y;
ELSE
Set P = y;
Set Q = χ;
ENDIF
PRINT P, Q, χ, y;
END
(i) State the name of the control structure shown in the flowchart. (1 mark)
______________________________________________________________________
______________________________________________________________________
Assuming the user keys in 8 and 14 when prompted to enter the values for m and N respectively, determine the printed values of P, Q, χ and y. (4 marks)
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
(iii) Draw a flowchart for the above pseudo-code. (5 marks)
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
(a) Describe three standard coding scheme used in computing and electronic systems. (3mks)
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
(b) Convert the decimal number 0.562510 into its binary equivalent. (3mks)
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
(c) Convert the binary number 110.101 to its Decimal equivalent. (3mks)
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
(d) Using twos Complement, perform the following binary arithmetic leaving the answer in binary notation. (3mks)
1001012 - 11012
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
(e) Other than the ring topology, describe other three types of topologies. (3mks)