A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Skeleton code/2013 Exam/Section C
Validation
[edit | edit source]
Error Checking List the Erroneous, Extreme and Typical Data for a user selecting a menu item: Answer:
Extreme data- Typical data – Letters “a, b, d, e, g, h, n” (in the original program). List the Erroneous, Extreme and Typical Data for Caeser Cipher Offset: Answer: |
Variables
[edit | edit source]
Variables State one advantage of using named constants for constant values Answer: Improves readability of code // Easier to update the programming code if the value changes ( A. by implication) // reduce the likelihood of errors;Give the identifier of a local variable Answer:
State the name of an identifier used for a pre-defined function with a single parameter Answer:
State the name of an identifier used for a variable that is used to control the iteration of a loop Answer:
State the name of a user-defined procedure/function that has exactly 3 parameters, and name them. Answer:
Give an example of an assignment statement: Answer:
Give an example of a variable declaration: Answer:
Give an example of the use of a variable that has the role of being a Most Recent Holder : Answer:
Give an example of the use of a variable that has the role of being a Stepper : Answer:
Give an example of the use of a variable that has the role of being a Gatherer : Answer:
|
Loops
[edit | edit source]
Loops Give the name of a stepper variable used in a loop? Answer:
Count
Give the name of a fixed variable used in a loop? Answer: Give the name of a follower used in a loop? Answer: Give the name of a most recent holder used in a loop? Answer: What is the purpose of nested loops? Answer: Why have they used FOR loops in the subroutine ???? Answer: |
Sub Routines
[edit | edit source]
Sub Routine Write down a function declaration used in the program Answer: Write down a function call used in the program Answer: Write down a procedure declaration used in the program Answer: Give the name of a parameter used in a procedure Answer: Explain the difference between using byRef and byVal Answer:
When a parameter is passed byRef, the variable inside the routine uses a reference to the same memory location as the variable passed as the parameter. When a parameter is passed byVal, the variable inside the routine copies the value of the calling code's variable to the routine's parameter.
Why is Byref used in the ????? sub routine? Answer:
ByRef is used because the procedure is then able to change the value that it was sent when it was called.
Write down where a return value for a function is assigned: Answer: Name the flag used in the sub routine ?????? and describe its purpose Answer: |