# A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Fundamentals of Programming/questions

## Variables

Using the source code below, answer the following questions:

Module Glocals
Dim number1 as integer = 123

Sub Main()
console.writeline(number1)
printLocalNumber()
printGlobalNumber()
End Sub

Sub printLocalNumber
Dim number1 as integer = 234
console.writeline(number1)
End Sub

Sub printGlobalNumber
console.writeline(number1)
End Sub
End Module
1. Name an identifier of a global variable
2. Copy down an assignment statement
3. For the following, add declaration statements including datatypes
1. The name of a person
2. The gender of a person
3. The DateOfBirth of a person
4. Whether a person is a teacher or not
4. Name the identifier of a local variable
5. Why wouldn't you use an integer to store a person's height in metres? What would you use instead?
6. Give an example of when you would use a Constant variable
7. Why would the following statement be unwise for a 100m race: dim winningTime as integer
8. What are the benefits of using a record?
9. What is the output of the above code?
10. Coded question...

## Data Structures

Using the following code answer the questions below:

1. How many dimensions does the array in the above code have?
2. Construct a trace table for the above code.
3. What does the code do?
4. Declare an empty data structure to store a chess board of 64 squares, allowing for the recording the colour of each square.
5. Why is it important to write files?
6. Write down the CSV code for the following data:
 Type Colour Cat Brown Dog Purple, with red bits

3 Validation 3.1 Constant Declarations 3.2 Selection 3.2.1 IF Statement 3.2.1.1 Nested Ifs 3.2.2 Case Statement 3.3 Iteration 3.4 Procedures and Functions 3.4.1 Declarations 3.4.2 Calls 3.4.3 Parameters 3.4.3.1 ByRef 3.4.3.2 ByVal