Professional Documents
Culture Documents
Diagnostic Test
Diagnostic Test
Diagnostic Test
DO
What will the following code output? * (1 Point)
SET count TO 0
SET x T0 9
WHILE x > 7 DO
SET count TO count + 1
Sele 0 Xe ed
END WHILE
SEND count TO DISPLAY
itps:iorms office. comipagesiresponsepage.aspxid=cYWp TercOUPsvdXclp-SdtYLDZ8)MIAD$aZ08VUMKNUMDFWNDKAVKMAW)RZS\IFQzk... 4/810122122, 9:55 AM Programming 3 Diagnostic Quiz
What will the following code output? * (1 Point)
SET count TO 0
SET output TO “”
WHILE count < 3 DO
SET count TO count + 1
SET output TO output & “x”
END WHILE
SEND output TO DISPLAY
no output
The following code has been written to input 10 numbers and add them up and
write out the total. Do you think it's ok, or if not, which line will be the cause of
the first compiler or run-time error? * (1 Point)
#1 FOR LoopCount FROM 1 TO 10 DO
#2 RECEIVE nextNumber FROM (INTEGER) KEYBOARD
#3 SET total TO total + nextNumber
#4 END FOR
#5 SEND nextNumber TO DISPLAY
No error
Line 1
itps:iorms office. comipagesiresponsepage aspxid=cYWp TercOUIPsvdXclp-SdrtYLDj28)MIAD$aZ08VUMKNUMDFWNDKAVKMAW)RZS\IFQzk... 5/810122122, 9:55 AM Programming 3 Diagnostic Quiz
Line 2
lines
Line 4
Line 5
Which code fragment will successfully complete the following program which
prints each wizards name one after the other. * (1 Point)
SET marauders TO [“Padfoot”, “Moony”, “Wormtail”, “Pro
SET wizard T0 0
REPEAT length(marauders) TIMES
SEND TO DISPLAY
SET wizard TO wizard + 1
END REPEAT
marauders[1]
marauders
marauders{wizard] 7
marauders{"Prongs"]
Padfoot
What will the computer display after executing the following program if the
user enters the number 3 for the first receive and 4 for the second? * (1 Point)
itpssiorms office. comipagesiresponsepage aspxid=cYWp TercOUIPsvdXclp-SdtYLDj28)MIAD$4Z08VUMKNUMDFWNDKAVKMAW)RZSJIFQzk... 6/810722822, 955 AM Programming 3 Diagnoste Quiz
RECEIVE a FROM (INTEGER) KEYBOARD
RECEIVE b FROM (INTEGER) KEYBOARD
SET b TO a
SET a TO b
SEND a TO DISPLAY
SEND b TO DISPLAY
34
43
3B
44
30
04
Rate your programming skills *
kee
Given the variables ‘harry’ and ‘hermione’ that contains 5.4 and 5.6 respectively,
which represent their height, what will be the output of the following code? *
(1 Point)
itpsiorms office. compagesiresponsepage.aspxid=cYWp TercOUPsQvdXclp-SdtYLDx28)MIAD$aZ08VUMKNUMDFWNDKAVKMAW)RZS\IFQzk... 7/810122122, 9:55 AM Programming 3 Diagnostic Quiz
IF harry > hermione THEN
SEND "Harry is taller" TO DISPLAY
ELSE
SEND "Hermione is taller" TO DISPLAY
END
Harry is taller
Hermione is taller 7
Harry is taller Hermione is taller
We need to determine whether someone is of working age. For this purpose we
can start working when we are 16 and stop working when we are 65. We have
the following if statement. Assuming that the person's age is held in the
variable personsAge, which is the best Boolean expression for this if statement?
* (1 Point)
IF THEN
ELSE
END IF
personsAge < 16 OR personsAge >= 65
personsAge < 16 OR personsAge > 65
personsAge >= 16 AND personsAge < 65
personsAge >= 16 AND personsAge <=65
itps:iorms office. comipagesiresponsepage aspxid=cYWp TercOUIPsvdXclp-SdtYLDj28)MIADsaZ08VUMKNUMDFWNDKAVKMAW)RZS\IFQzk... 8/810122122, 9:55 AM Programming 3 Diagnostic Quiz
(Send me an email receipt of my responses
‘This content is created by the owner of the form. The data you submit will be sent to the form owner. Microsoft is not
responsible forthe privacy or security practices ofits customers, including those of this form owner. Never give out your
password
Powered by Microsoft Forms | Privacy and cookies | Terms of use
itpssiorms offic. compagesiresponsepage.aspxid=cYWp TercOUPsQvdXclp-SdtYLDjx28)MIAD$aZ08VUMKNUMDFWNDKAVKMAW)RZS\IFQzk... 918