A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Fundamentals of Programming/questions
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
- Name an identifier of a global variable
- Copy down an assignment statement
- For the following, add declaration statements including datatypes
- The name of a person
- The gender of a person
- The DateOfBirth of a person
- Whether a person is a teacher or not
- Name the identifier of a local variable
- Why wouldn't you use an integer to store a person's height in metres? What would you use instead?
- Give an example of when you would use a Constant variable
- Why would the following statement be unwise for a 100m race:
dim winningTime as integer
- What are the benefits of using a record?
- What is the output of the above code?
- Coded question...
Using the following code answer the questions below:
- How many dimensions does the array in the above code have?
- Construct a trace table for the above code.
- What does the code do?
- Declare an empty data structure to store a chess board of 64 squares, allowing for the recording the colour of each square.
- Why is it important to write files?
- Write down the CSV code for the following data:
|Dog||Purple, with red bits|
3 Validation 3.1 Constant Declarations 3.2 Selection 3.2.1 IF Statement 188.8.131.52 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 184.108.40.206 ByRef 220.127.116.11 ByVal
4 Fundamentals of Structured Programming 4.1 structure tables 4.2 structure charts 4.3 hierarchy charts 4.4 Good Coding Practice 4.4.1 Use procedures that execute a single task 4.4.2 Use procedures/functions with interfaces 4.4.3 Use sensible variable datatypes 4.4.4 Meaningful identifier names 18.104.22.168 Use sensible variable names 22.214.171.124 Use sensible Function/Procedure names 4.4.5 Try to stick to one naming convention 4.4.6 Don't make your names too long 4.4.7 Indent your work 4.4.8 Use comments where necessary 4.5 The advantages of the structured approach
2.1 One-Dimensional Arrays 2.2 Two-Dimensional Arrays 2.3 Fields 2.4 Records 2.5 Files 3 Validation 4 Fundamentals of Structured Programming 4.1 Constant Declarations 4.2 Selection 4.2.1 IF Statement 126.96.36.199 Nested Ifs 4.2.2 Case Statement 4.3 Iteration 4.4 Procedures and Functions 4.4.1 Declarations 4.4.2 Calls 4.4.3 Parameters 188.8.131.52 ByRef 184.108.40.206 ByVal 5 Good Coding Practice 5.1 Use sensible variable datatypes 5.2 Use sensible variable names 5.3 Use sensible Function/Procedure names 5.4 Try to stick to one naming convention 5.5 Don't make your names too long 5.6 Indent your work 5.7 Use comments where necessary