For Next Trace Table 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

0001 Aaron Baxter Page 1 of 4

Computer Science (Visual Basic) CODE REVIEW ForNextTraceTable1 0001 Aaron Baxter

This program displays the value of Index during the execution of a FOR NEXT loop.

1 Name one important comment that is missing from this program. [1]

..............................................................................................................................................................................................................

2 Where is a good place to declare the variables in a program and explain why? [2]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

3 Carefully list the details of variable(s) in this program: [1]

ForNextTraceTable1

Line Number Variable Identifier Data Type

4 List 4 data types available in Visual Basic [4]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

5 What is the value of Index after line 5 [1]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

6 What is the difference between Console.Write() and Console.WriteLine()? [2]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................
0001 Aaron Baxter Page 2 of 4

7 What text will this line of code display on the screen? i.e., what is the value of Index at the end of the
FOR NEXT loop [2]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

8 What would happen if this line of code was deleted? [2]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

9 List at least 4 Visual Basic reserved words in this program? [2]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

10 What is the purpose of the symbol & in Visual Basic. Carefully write out what would be displayed on the screen
at line 11.? [3]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

11 It is not possible to use words like “Integer” or “For” as variable identifiers in Visual Basic why is this? [2]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................
0001 Aaron Baxter Page 3 of 4

12 Visual Studio 2019 can be used to find a bug in your programming code. What do you need to mark in your
code so that the program will stop during execution (running) and allow you to watch the variables and run the
program one line at a time? [1]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

13 Give at least two reasons why you might trace a piece of code that you have not seen before? [4]

..............................................................................................................................................................................................................

..............................................................................................................................................................................................................

14 What is another way to say Variable Identifier? [1]

..............................................................................................................................................................................................................

15 What Visual Basic reserved word is used to declare a variable? [1]

..............................................................................................................................................................................................................
0001 Aaron Baxter Page 4 of 4

You might also like