411 REFERENCE · Wikibooks
A-level Computing 2009/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Skeleton code/2013 Exam/Section C
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Validation
Error Checking
List the Erroneous, Extreme and Typical Data for a user selecting a menu item:
Erroneous data – Anything other than “a, b, d, e, g, h, n” (in the original program, an example would be “z” or “2”).
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:
Variables
Variables
State one advantage of using named constants for constant values
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
Any from;
Ciphertext, Plaintext, Choice, AmountToShift, StartPosition, EndPosition, SizeOfRailFence, N,MenuChoice, TextFromUser, CharacterFromFile, TextFromFile, Count, Key, TypeOfCharacter, ChangedText, ASCIICode, NoOfColumns, NoOfRows, NoOfCiphertextCharacters, NoOfCiphertextCharactersProcessed, i, j, PostitionOfNextCharacter, LastFullRowNo, AmountToReduceNoOfColumnsTimesjBy, BeginningOfNextRowIndex, HiddenMessage, CurrentPosition.
State the name of an identifier used for a pre-defined function with a single parameter
VB.net = Asc("a")
State the name of an identifier used for a variable that is used to control the iteration of a loop
Count.
State the name of a user-defined procedure/function that has exactly 3 parameters, and name them.
EveryNthCharacterSteganography(StartPosition, EndPosition, N)
Give an example of an assignment statement:
Plaintext = ""
Give an example of a variable declaration:
VB.net - Dim N As Integer
Give an example of the use of a variable that has the role of being a Most Recent Holder :
textFromUser
Give an example of the use of a variable that has the role of being a Stepper :
Count
Give an example of the use of a variable that has the role of being a Gatherer :
ciphertext
Loops
Loops
Give the name of a stepper variable used in a loop?
Count
Give the name of a fixed variable used in a loop?
Give the name of a follower used in a loop?
Give the name of a most recent holder used in a loop?
What is the purpose of nested loops?
Why have they used FOR loops in the subroutine ????
Sub Routines
Sub Routine
Write down a function declaration used in the program
Write down a function call used in the program
Write down a procedure declaration used in the program
Give the name of a parameter used in a procedure
Explain the difference between using byRef and byVal
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?
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:
Name the flag used in the sub routine ?????? and describe its purpose