0% found this document useful (0 votes)
17 views5 pages

RevisionTest2 Dev1 .

Development software
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

RevisionTest2 Dev1 .

Development software
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
© Question 1 3 points Given that cost is a numeric variable, which of the following is a valid pseudocode instruction to test if the cost is over R1000-00. A. IF cost > R1000 THEN RIF cast >= R1000 THEN C._ IF cost =R1000 AND cost > R1000 THEN D. NONE OF THESE © Question 2 3 points Given that cost is a numeric variable, which of the following is not a valid pseudocode instruction DECLARE cost As Real DECLARE cost As Interger ALL OF THESE DECLARE cost As Integer pomp * Question 3 3 points Given that XX= 4, XY = 2, and XZ = 1.5, the following code will display FALSE on the screen: IF XX < XZ THEN DISPLAY “TRUE” ELSE DISPLAY "FALSE" ENDIF A. TRUE B. FALSE © Question 4 18 points ESSAY QUESTION ‘The Zaid Health Gym is giving special prices on workout sessions to new members. ‘The price for one session is based on different criteria as shown below: a. for anyone whose hometown is not Mthatha: R200 b. for anyone whose age is over 45: R100 ‘They want a program which will accept the person's hometown and age . ‘The program must then calculate and display the total price the person will pay for 50 sessions. DO THE FOLLOWING: a. Draw the IPO chart for the program [5 marks ] ‘You can write each column heading and the contents under each other. b. Write the FULL Pseudocode AND Draw the Flow Chart for the program. [23 marks ] + Question 5 3 points Evaluate k=a+b*2mod4+d+4%(10-c*d)\a where a=2,b=10,c=8,d=9mod 14 + Question 6 3 points What is displayed on the screen by the following code if SUM is 8 and NUM is 2, WHY? IF SUM-NUM> 4 + NUM THEN, ‘SUM = SUM*2 ENDIF DISPLAY SUM * Question 4 18 points ESSAY QUESTION. ‘The Zaid Health Gym is giving special prices on workout sessions to new members. ‘The price for one session is based on different criteria as shown below: a. for anyone whose hometown is not Mthatha: R200 b. for anyone whose age is over 45: R100 ‘They want a program which will accept the person's hometown and age . ‘The program must then calculate and display the total price the person will pay for 50 sessions. DO THE FOLLOWING: a. Draw the IPO chart for the program [5 marks ] ‘You can write each column heading and the contents under each other. b. Write the FULL Pseudocode AND Draw the Flow Chart for the program. [23 marks ] © Question S 3 points Evaluate k=a+b*2mod4+d+4*(10-c*d)\a where a=2, b= 10,c=8,d=9 mod 14 + Question 6 3 points What is displayed on the screen by the following code if SUM is 8 and NUM is 2, WHY? IF_SUM-NUM> 4 + NUM THEN, ‘SUM = SUM*2 ENDIF DISPLAY SUM * Question 7 3 points What is displayed on the screen by the following code if RED is input, WHY? DECLARE MSG, COLOUR AS STRING ACCEPT COLOUR IF COLOUR = “RED” THEN MSG = "YES" ENDIF MSG = "NO" DISPLAY “COLOUR IS RED “MSG * Question 8 3 points Evaluate 16 MOD 3 *2 <> 3*6-4 MOD 2, TRUE OR FALSE? SHOW YOUR WORK. * Question 9 3 points What value is in AVERAGE afier this instruction is executed, if MARK{ is 75 and MARK is 63 AVERAGE = MARK1 + MARK 2/2 A 69 B. 106.5 c. 138 D. NONE OF THESE © Question 10 3 points What is displayed on the screen by the following code if TOT1 is 20 and TOT2 is 5 IF TOT2*5>30 THEN DISPLAY TOT2 ELSE DISPLAY TOT1 ENDIF A. ToT2 BOS c. Tom D. 20 © Question 11 3 points What value is displayed on the screen by the following code if input is: 46 BEGIN DECLARE temperature AS real ACCEPT temperature IF temperature > 35 THEN DISPLAY “1 am going to the beach” ELSE DISPLAY “I am staying at home" ENDIF END © Question 12 2 points IF WEIGHT <= 50 THEN is the correct condition to use to check if a person weighs more than 50 kgs AL TRUE B. FALSE

You might also like