The reason we use a DIM statement in a computer program is? A) To declare the variable names and types before using them B) To tell VB if the variable is a numeric or string variable C) To help us remember the names of the variables D) To tell the program how many variables we will use ANSWER: A I write a program to record student absences. The best data type for a variable to store if a student is present in class would be A) String B) Boolean C) Integer D) Character ANSWER: B I want to find the larger of two numbers, num1 and num2. The most appropriate code would be A) If num1>num2 then num2 is smaller B) If num1=num2 then the numbers are equal C) If num1>num2 then num1 is larger D) If num1>=num2 then num1 is larger ANSWER: C I write a line of code to produce a random whole number between 1 and 10. Num=int(rnd()*10+1. When I run the program I get an error. The most likely type of error is A) Run time error B) Logical error C) Syntax error D) Random error ANSWER: C I write a program to guess a random number between 1 and 10. I use variables of num( the random number), guess( my guess) and tries( the number of attempts). The most appropriate code to increment the number of tries would be A) tries= guess+1 B) tries=tries +1 C) tries= tries+num D) tries = guess+num ANSWER: B I write a program to guess a random number between 1 and 10. I use variables of num( the random number), guess( my guess) and tries( the number of attempts). The most appropriate code to see if have guessed the number would be A) if guess=num then correct B) if guess=tries the correct C) if guess <> num then incorrect D) if guess>=num then correct ANSWER: A I write a program to guess a random number between 1 and 10. I use variables of num( the random number), guess( my guess) and tries( the number of attempts). I wish to validate my input. The most appropriate code would be A) if num>10 then invalid B) if guesss>=10 then invalid C) if guess>10 then invalid D) if guess>tries then invalid ANSWER: C I write a program to guess a random number between 1 and 10. I use variables of num( the random number), guess( my guess) and tries( the number of attempts). I include code to validate my input. The most appropriate data to test my validation would be A) 10 B) 11 C) 9,10 D) 9,10,11 ANSWER: D Which of the following is NOT a design tool used for programming tasks A) Flowchart B) Storyboard C) Algorithm D) Pseudocode ANSWER: B I want to store a phone number (03) 8765 3456 in a variable. The most appropriate type of variable would be A) Integer B) Numeric C) String D) Boolean ANSWER: C I want to output a number from a program into a label on a form. The property of the label that is most suitable for this task is A) .enabled B) .visible C) .size D) .text ANSWER: D I want a program to add all the even numbers from 1 to 100. The most appropriate loop instruction would be A) For counter = 1 to 100 step 2 B) For counter = 2 to 100 step 2 C) For counter = 1 to 100 step even D) For counter = 2 to 100 ANSWER: B I set up a VB form to use a picturebox containing a triangle. The most appropriate name for the picture box would be A) Pbtriangle B) Triangle C) Picturebox1 D) Pictureboxtriangle ANSWER: A The purpose of an ELSE statement in VB is A) To tell the program what to do when the IF it true B) To tell the program what to do when the IF it false C) To give the program more than one alternative D) To allow a second IF statement to be used ANSWER: B A convention for VB forms would be A) A grey background B) The use of buttons C) A heading at the top of the form D) Use large font size ANSWER: C Pseudocode is A) An algorithm design tool B) A coding language that is not VB specific C) Allows a problem to be solved before coding D) All of the above ANSWER: D Which of the following is a looping structure in VB? A) If then else B) Repeat Until C) If Loop D) For While ANSWER: B I write a program to find the average of a set of numbers. When I run the program, I get an error saying “Division by zero”. The most likely cause of this error is A) There were too many numbers B) There were too few numbers C) I used the wrong variable to divide the total by D) I printed out the wrong variable ANSWER: C A string variable can store A) A number B) Text C) A true or false D) All of the above ANSWER: D I write a program to guess a random number between 1 and 10. I use variables of num( the random number), guess( my guess) and tries( the number of attempts). When I run the program, I am never able to guess the correct number. This is most likely caused by a A) Logical error B) Syntax error C) Run time error D) All of the above ANSWER: A