Quiz+4+Review

Quiz 4 Review

Which statement is correct? a) var name: string b) var string: name c) string name: var

Which one is a predefined Turing graphic? a) drawoval b) drawsquare c) drawcircle

Counted loops are sometimes called a) Conditional loops b) Iterative loops c) Nested loops

The get statement.. a) allows the user to interact with the program by providing data for the program to use b) tells the computer to wait for input from the user <span style="font-family: Arial,Helvetica,sans-serif;">c) inputs a value into a program from the keyboard <span style="font-family: Arial,Helvetica,sans-serif;">d) all of the above

<span style="font-family: Arial,Helvetica,sans-serif;">Loops must be accompanied by.. <span style="font-family: Arial,Helvetica,sans-serif;">a) an else condition <span style="font-family: Arial,Helvetica,sans-serif;">b) a put statement <span style="font-family: Arial,Helvetica,sans-serif;">c) an exit when <span style="font-family: Arial,Helvetica,sans-serif;">d) an end loop

<span style="font-family: Arial,Helvetica,sans-serif;">How do you locate X and/or Y? <span style="font-family: Arial,Helvetica,sans-serif;">A) locate_xy <span style="font-family: Arial,Helvetica,sans-serif;">B) locatexy <span style="font-family: Arial,Helvetica,sans-serif;">C) locate xy

<span style="font-family: Arial,Helvetica,sans-serif;">What is 'var' <span style="font-family: Arial,Helvetica,sans-serif;">A) a variable <span style="font-family: Arial,Helvetica,sans-serif;">B) a number <span style="font-family: Arial,Helvetica,sans-serif;">C) nothing

<span style="font-family: Arial,Helvetica,sans-serif;">How do you make a counted loop? <span style="font-family: Arial,Helvetica,sans-serif;">A) loop counted:1 put "Hello!" endloop <span style="font-family: Arial,Helvetica,sans-serif;">B) var count, square: int for count: 1..5 square:= count2 put "The square of ", count, "is ", square, "." end for <span style="font-family: Arial,Helvetica,sans-serif;">C) put "Hey!" loop int: 6 count: 1.6 end loop

<span style="font-family: Arial,Helvetica,sans-serif;">When it comes to if statements, what do u need to include: <span style="font-family: Arial,Helvetica,sans-serif;">a) If, else if, else <span style="font-family: Arial,Helvetica,sans-serif;">b) If, proc, for, <span style="font-family: Arial,Helvetica,sans-serif;">c) Else, for, what <span style="font-family: Arial,Helvetica,sans-serif;">d) None of the above

<span style="font-family: Arial,Helvetica,sans-serif;">What does the command getch do? <span style="font-family: Arial,Helvetica,sans-serif;">a) Gets a character off the keyboard from the user <span style="font-family: Arial,Helvetica,sans-serif;">b) Gets a number from the user <span style="font-family: Arial,Helvetica,sans-serif;">c) Uses a number previously used by the programmer <span style="font-family: Arial,Helvetica,sans-serif;">d) None of the above

<span style="font-family: Arial,Helvetica,sans-serif;">What does the command cls do? <span style="font-family: Arial,Helvetica,sans-serif;">a) It does something? <span style="font-family: Arial,Helvetica,sans-serif;">b) It clears the screen <span style="font-family: Arial,Helvetica,sans-serif;">c) It clears the program memory <span style="font-family: Arial,Helvetica,sans-serif;">d) It does nothing, it’s not a command.

<span style="font-family: Arial,Helvetica,sans-serif;">How many variables can be used in a program? <span style="font-family: Arial,Helvetica,sans-serif;">A-Unlimited seeing as they are properly declared. <span style="font-family: Arial,Helvetica,sans-serif;">B-5 and under <span style="font-family: Arial,Helvetica,sans-serif;">C-10 and under <span style="font-family: Arial,Helvetica,sans-serif;">D-Unlimited

<span style="font-family: Arial,Helvetica,sans-serif;">What does “cls” do in touring? <span style="font-family: Arial,Helvetica,sans-serif;">A-Make you an ice cone <span style="font-family: Arial,Helvetica,sans-serif;">B-Clears screen <span style="font-family: Arial,Helvetica,sans-serif;">C-Gets a character <span style="font-family: Arial,Helvetica,sans-serif;">D-The programmer meant to type “CIA”

<span style="font-family: Arial,Helvetica,sans-serif;">Who is the programmer? <span style="font-family: Arial,Helvetica,sans-serif;">A-The person using the programme <span style="font-family: Arial,Helvetica,sans-serif;">B-The person reviewing the program <span style="font-family: Arial,Helvetica,sans-serif;">C-The person who wrote the program <span style="font-family: Arial,Helvetica,sans-serif;">D-The genius computer that developed it internally.

<span style="font-family: Arial,Helvetica,sans-serif;">What is an example of an int? <span style="font-family: Arial,Helvetica,sans-serif;">a) A <span style="font-family: Arial,Helvetica,sans-serif;">b) 15 <span style="font-family: Arial,Helvetica,sans-serif;">c) “multiple choice”

<span style="font-family: Arial,Helvetica,sans-serif;">What is the output for : put 4 + 6 * 3/2 <span style="font-family: Arial,Helvetica,sans-serif;">a) 13 <span style="font-family: Arial,Helvetica,sans-serif;">b) 15 <span style="font-family: Arial,Helvetica,sans-serif;">c) 8

<span style="font-family: Arial,Helvetica,sans-serif;">Delay (8000) will delay for how many seconds? <span style="font-family: Arial,Helvetica,sans-serif;">a) 0.8 seconds <span style="font-family: Arial,Helvetica,sans-serif;">b) 8 seconds <span style="font-family: Arial,Helvetica,sans-serif;">c) 0.08 seconds

<span style="font-family: Arial,Helvetica,sans-serif;">Put 10 +11. What is the answer? <span style="font-family: Arial,Helvetica,sans-serif;">a) 1011 <span style="font-family: Arial,Helvetica,sans-serif;">b) 111 <span style="font-family: Arial,Helvetica,sans-serif;">c) 21 <span style="font-family: Arial,Helvetica,sans-serif;">d) Error message.

<span style="font-family: Arial,Helvetica,sans-serif;">Which is NOT a rule for Variables? <span style="font-family: Arial,Helvetica,sans-serif;">a) No blank spaces. <span style="font-family: Arial,Helvetica,sans-serif;">b) They can use reserved words. <span style="font-family: Arial,Helvetica,sans-serif;">c) They are case sensitive. <span style="font-family: Arial,Helvetica,sans-serif;">d) They must begin with a letter.

<span style="font-family: Arial,Helvetica,sans-serif;">What is a constant? <span style="font-family: Arial,Helvetica,sans-serif;">a) A variable that can change at any time. <span style="font-family: Arial,Helvetica,sans-serif;">b) Sometimes declared and assigned to the same statement. <span style="font-family: Arial,Helvetica,sans-serif;">c) Assigns a value that will never change. <span style="font-family: Arial,Helvetica,sans-serif;">d) None of the above.

<span style="font-family: Arial,Helvetica,sans-serif;">What code would you use to produce a count from 1 to 5 <span style="font-family: Arial,Helvetica,sans-serif;">a) for C : 1..5 <span style="font-family: Arial,Helvetica,sans-serif;">Put C <span style="font-family: Arial,Helvetica,sans-serif;">end for

<span style="font-family: Arial,Helvetica,sans-serif;">b) for c : 1..5 <span style="font-family: Arial,Helvetica,sans-serif;">Put c <span style="font-family: Arial,Helvetica,sans-serif;">End for

<span style="font-family: Arial,Helvetica,sans-serif;">c) for o : 0..5 <span style="font-family: Arial,Helvetica,sans-serif;">put o <span style="font-family: Arial,Helvetica,sans-serif;">end for

<span style="font-family: Arial,Helvetica,sans-serif;">d) for D : 1..5 <span style="font-family: Arial,Helvetica,sans-serif;">put D <span style="font-family: Arial,Helvetica,sans-serif;">end for

<span style="font-family: Arial,Helvetica,sans-serif;">An if statement be used within a loop?

<span style="font-family: Arial,Helvetica,sans-serif;">True _

<span style="font-family: Arial,Helvetica,sans-serif;">False _

<span style="font-family: Arial,Helvetica,sans-serif;">the line exit when hasch will do <span style="font-family: Arial,Helvetica,sans-serif;">a) give the program a list of characters <span style="font-family: Arial,Helvetica,sans-serif;">b) exit a loop when a key is pressed <span style="font-family: Arial,Helvetica,sans-serif;">c) pause the program until a key is pressed <span style="font-family: Arial,Helvetica,sans-serif;">d) delete the program

<span style="font-family: Arial,Helvetica,sans-serif;">the line sound(440,6000) will do <span style="font-family: Arial,Helvetica,sans-serif;">a)create a sound with a frequency of 440hrtz and a duration of 6s. <span style="font-family: Arial,Helvetica,sans-serif;">b) output a sound with a frequency of 6000hrtz and a duration of 0.44s. <span style="font-family: Arial,Helvetica,sans-serif;">c) output 2 brief tones of 440hrtz and 6000hrtz <span style="font-family: Arial,Helvetica,sans-serif;">d) do nothing

<span style="font-family: Arial,Helvetica,sans-serif;">Which would not draw a line? <span style="font-family: Arial,Helvetica,sans-serif;">a)Drawline(1,100,3,300,9) <span style="font-family: Arial,Helvetica,sans-serif;">b)Drawbox(1,1,1,100,1) <span style="font-family: Arial,Helvetica,sans-serif;">c)Drawline(100,10,10,10,25) <span style="font-family: Arial,Helvetica,sans-serif;">d)Drawbox(100,100,100,100,100)

<span style="font-family: Arial,Helvetica,sans-serif;">an if statement can perform the function of a loop? <span style="font-family: Arial,Helvetica,sans-serif;">true false

<span style="font-family: Arial,Helvetica,sans-serif;">What will be the output of this program?

<span style="font-family: Arial,Helvetica,sans-serif;">var x : int <span style="font-family: Arial,Helvetica,sans-serif;">var y : int <span style="font-family: Arial,Helvetica,sans-serif;">var c : int <span style="font-family: Arial,Helvetica,sans-serif;">x := 100 <span style="font-family: Arial,Helvetica,sans-serif;">y := 100 <span style="font-family: Arial,Helvetica,sans-serif;">loop <span style="font-family: Arial,Helvetica,sans-serif;">randint (c, 0, maxcolor) <span style="font-family: Arial,Helvetica,sans-serif;">x := x + 2 <span style="font-family: Arial,Helvetica,sans-serif;">y := y + 2 <span style="font-family: Arial,Helvetica,sans-serif;">delay (50) <span style="font-family: Arial,Helvetica,sans-serif;">drawfilloval (x, y, 10, 10, c) <span style="font-family: Arial,Helvetica,sans-serif;">exit when y > maxy <span style="font-family: Arial,Helvetica,sans-serif;">end loop

<span style="font-family: Arial,Helvetica,sans-serif;">a) A green ball moving diagonally down by 3 exiting when reaching maxx <span style="font-family: Arial,Helvetica,sans-serif;">b) A multi-colored ball moving diagonally up by 2 exiting when reaching maxy <span style="font-family: Arial,Helvetica,sans-serif;">c) An error message <span style="font-family: Arial,Helvetica,sans-serif;">d) A multi-colored ball moving diagonally up by 2 exiting when reaching maxx

<span style="font-family: Arial,Helvetica,sans-serif;">What is the output of this program?

<span style="font-family: Arial,Helvetica,sans-serif;">loop <span style="font-family: Arial,Helvetica,sans-serif;">for : 1 .. 5 <span style="font-family: Arial,Helvetica,sans-serif;">put "Whats" <span style="font-family: Arial,Helvetica,sans-serif;">put "^" <span style="font-family: Arial,Helvetica,sans-serif;">end for <span style="font-family: Arial,Helvetica,sans-serif;">end loop

<span style="font-family: Arial,Helvetica,sans-serif;">a) Whats and ^ repeated infinitly <span style="font-family: Arial,Helvetica,sans-serif;">b) Whats and ^ repeated infinitly in groups of 5 <span style="font-family: Arial,Helvetica,sans-serif;">c) An error message <span style="font-family: Arial,Helvetica,sans-serif;">d) Whats and ^ repeated 5 times

<span style="font-family: Arial,Helvetica,sans-serif;">Which one of the following is NOT one of the rules a variable identifier must follow. <span style="font-family: Arial,Helvetica,sans-serif;">a) They must begin with a letter <span style="font-family: Arial,Helvetica,sans-serif;">b) They can’t use reserved words <span style="font-family: Arial,Helvetica,sans-serif;">c) They can’t have any blank spaces <span style="font-family: Arial,Helvetica,sans-serif;">d) They can’t have any numbers

<span style="font-family: Arial,Helvetica,sans-serif;">The else condition takes care of any possibility not otherwise accounted for by the series of if's &_’s. <span style="font-family: Arial,Helvetica,sans-serif;">a) End if <span style="font-family: Arial,Helvetica,sans-serif;">b) Elsif <span style="font-family: Arial,Helvetica,sans-serif;">c) For <span style="font-family: Arial,Helvetica,sans-serif;">d) Else

<span style="font-family: Arial,Helvetica,sans-serif;">Turing processes mathematical expressions in what order? <span style="font-family: Arial,Helvetica,sans-serif;">a) Exponents, multiplication, division, parenthesis, subtraction, addition <span style="font-family: Arial,Helvetica,sans-serif;">b) Multiplication, division, parenthesis, exponents, subtraction, addition <span style="font-family: Arial,Helvetica,sans-serif;">c) Parenthesis, exponents, division, multiplication, addition, subtraction <span style="font-family: Arial,Helvetica,sans-serif;">d) Exponents, parenthesis, multiplication, division, addition, subtraction

<span style="font-family: Arial,Helvetica,sans-serif;">What’s missing from the following formula? <span style="font-family: Arial,Helvetica,sans-serif;">var square: int <span style="font-family: Arial,Helvetica,sans-serif;">for count: 1..5 square:= count**2 <span style="font-family: Arial,Helvetica,sans-serif;">put "The square of ", count, "is ", square, "." <span style="font-family: Arial,Helvetica,sans-serif;">end for <span style="font-family: Arial,Helvetica,sans-serif;">delay (100) <span style="font-family: Arial,Helvetica,sans-serif;">end

<span style="font-family: Arial,Helvetica,sans-serif;">a)loop, loop <span style="font-family: Arial,Helvetica,sans-serif;">b)get, loop <span style="font-family: Arial,Helvetica,sans-serif;">c)put, loop <span style="font-family: Arial,Helvetica,sans-serif;">d)get, nacho

<span style="font-family: Arial,Helvetica,sans-serif;">What is the Turing procedure for a mapleleaf? <span style="font-family: Arial,Helvetica,sans-serif;">A)drawTorontorocks <span style="font-family: Arial,Helvetica,sans-serif;">b)drawmarchofthedead <span style="font-family: Arial,Helvetica,sans-serif;">c)drawmapleleaf <span style="font-family: Arial,Helvetica,sans-serif;">d)drawthecrazy

<span style="font-family: Arial,Helvetica,sans-serif;">How many put statements do you need for this statement “how much wood could a wood chuck could chuck would if a wood chuck could chuck wood?”

<span style="font-family: Arial,Helvetica,sans-serif;">a) 5

<span style="font-family: Arial,Helvetica,sans-serif;">b) 1

<span style="font-family: Arial,Helvetica,sans-serif;">c) 98

<span style="font-family: Arial,Helvetica,sans-serif;">d) 6

<span style="font-family: Arial,Helvetica,sans-serif;">What statement do you use to get the user to enter something?

<span style="font-family: Arial,Helvetica,sans-serif;">a) get

<span style="font-family: Arial,Helvetica,sans-serif;">b) put

<span style="font-family: Arial,Helvetica,sans-serif;">c) locatexy

<span style="font-family: Arial,Helvetica,sans-serif;">d) maxx

<span style="font-family: Arial,Helvetica,sans-serif;">How do you declare a variable?

<span style="font-family: Arial,Helvetica,sans-serif;">a) var a : int

<span style="font-family: Arial,Helvetica,sans-serif;">b) var b : string

<span style="font-family: Arial,Helvetica,sans-serif;">c) var c: real

<span style="font-family: Arial,Helvetica,sans-serif;">d) All of the above

<span style="font-family: Arial,Helvetica,sans-serif;">How many types of loops are there <span style="font-family: Arial,Helvetica,sans-serif;">a) 2 <span style="font-family: Arial,Helvetica,sans-serif;">b) 5 <span style="font-family: Arial,Helvetica,sans-serif;">c) 3

<span style="font-family: Arial,Helvetica,sans-serif;">when can you use the command “exit” <span style="font-family: Arial,Helvetica,sans-serif;">a) anywhere in your program <span style="font-family: Arial,Helvetica,sans-serif;">b) only in a loop <span style="font-family: Arial,Helvetica,sans-serif;">c)only in a for statement <span style="font-family: Arial,Helvetica,sans-serif;">d)both b,c

<span style="font-family: Arial,Helvetica,sans-serif;">what would be the output of 6/3*1 div 4 <span style="font-family: Arial,Helvetica,sans-serif;">a) 0.5 <span style="font-family: Arial,Helvetica,sans-serif;">b) 0 <span style="font-family: Arial,Helvetica,sans-serif;">c) 3

<span style="font-family: Arial,Helvetica,sans-serif;"> How to you end an if statement? a) end if   b) if end c) End if   d) else if    e) elseif    f) none of d above You need to declare variables in an if? a) True   b) False What does an elseif do? <span style="margin: 0in 0in 0pt 0.75in; mso-add-space: auto; mso-list: l0 level1 lfo3; text-indent: -0.25in;"> a) End the program <span style="margin: 0in 0in 0pt 0.75in; mso-add-space: auto; mso-list: l0 level1 lfo3; text-indent: -0.25in;"> b) Gets any statements <span style="margin: 0in 0in 0pt 0.75in; mso-add-space: auto; mso-list: l0 level1 lfo3; text-indent: -0.25in;"> c) Gets statements based on determined variables <span style="margin: 0in 0in 0pt 0.75in; mso-add-space: auto; mso-list: l0 level1 lfo3; text-indent: -0.25in;"> d) Declares variables in the if  <span style="margin: 0in 0in 10pt 0.75in; mso-add-space: auto; mso-list: l0 level1 lfo3; text-indent: -0.25in;"> e) None of the above