Programming Flashcards
What are the five data types
Integer, real/float, string, character and Boolean
What is integer
Integer is a whole number
What is a real/float?
A real is a decimal number
What is character?
A character is a single letter or number
What is a string?
A piece of text
What is a Boolean?
TRUE or FALSE
What is a sequence?
This is a set of instructions that follow on one from another
What is a selection ?
A decision within a computer program when the program decides to move on based on the results of an event.
What is iteration?
The repetition of a block of statements within a computer program.
What is a variable ?
Data that changes
What is a constant ?
Data that remains the same
What is an array?
One method of storing data in an organised structure
What is a constant declaration ?
A value that increases or decreases at a constant rate each time
What is an assignment?
The instruction that is carried out in order to get the variable value
Python examples of input ?
Text, click button
Python examples of output?
Sound, image
Python example of reading from a file ?
Asking the program to select and output an output from the list
Python example of writing to a file ?
Editing the file like adding items or removing items
What are some types of low level languages?
Machine language, assembly language and mnemonics
What are some types of high level language?
Source / machine code
What is the job of interpreter ?
It turns high level language into low level language, assembly language and Binary language
What is the job of compiler?
It turns high level language into lower level language
What is the job of assembler?
It turns computer instructions into binary
What is an identifier ?
A name given to a part of a program, such as a variable, constant, function, procedure or module.
What is concatenation?
The joining together of two or more strings or substrings
What is string handling ?
A string is a variable that holds a sequence of one or more alphanumeric characters. These characters can be letters, numbers or symbols. It is usually possible to manipulate a string to provide information or to alter the contents of a string.
What are the examples of string handling?
Length, position, substring, concatenation, string conversion, character set conversion
What is a length?
The length of a string can be determined using the pseudocode LEN. This gives the length as an integer.
LEN(wordOne) - would give the answer “eight”, as there are eight characters in the word “Computer”
What is positions?
It is possible to determine which character features at a position within a string:
wordOne[2] - would give the answer “m”, as m is the third character in the word “Computer” (remember computers start counting at zero).
What is substring?
A substring is a string of characters that exists inside a string, for example, the first three characters of a password.
What is string conversion?
Sometimes a programmer needs to change the data type stored within a variable. For example, an integer may need to be converted to a string in order to be displayed as part of a message. This process is known as casting. The following examples convert a string to an integer and an integer to a string using Python:
str(68) returns “68”
int(“54”) returns 54
What is character set conversions?
Another way of dealing with data is to convert alphanumeric data into its numerical format in a character set. The pseudo-code CHAR_TO_CODE and CODE_TO_CHAR functions allow characters to be swapped between their text and number formats using the ASCII or UNICODE character set.
What is subroutine?
Portion of code that may be called to execute anywhere in a program.
What is parameters ?
a parameter is a value that is passed into a function or procedure.
What three areas should designing robust programs encompass?
- protection against unexpected user inputs or actions, such as a user entering a letter where a number was expected
- confirming that users on a computer system are who they say they are
- minimising or removing bugs
What is validation ?
Checking input data is sensible and in the right format.
What is authentication ?
Verifying the identity of a user.
What is testing ?
An important part of computer programming which involves checking a program for errors.
What is a test data?
Data input when testing to see if the program produces the expected results.