Programming Flashcards
What is a variable?
A named space in memory large enough to store a single data type
What is a constant?
A named space in memory with a value that never changes while the program is running
What are the 5 data types?
Boolean
Character (not in python)
Integer
Real
String
What is declaration?
Code that causes a variable to exist
What is assignment?
The process of putting a value into a variable
What is the difference between definite and indefinite iteration?
Indefinite iteration is iteration using while loops and so carries on idefinitely till the conditional statement
Definite iteration is iteration using for loops and so is used a set number of times initially specified
What are operations? What are the 3 types?
Operations are an action performed on one or more pieces of data in order to produce additional data
Arithmetic (+, -, *, /)
Relational (<, >, ==, !=)
Logical (and, or, not)
What are the two types of data structures and their differences?
One-dimensional arrays store same data types with each element referenced by an index number
Two-dimensional arrays store same data types in a grid referenced by row then column
What is a record?
A data structure that can accept multiple data items of different types. A row in a database
What is an input and output?
Input is the process of introducing data to a system
Output is the process of communicating data beyond the system
What is a file?
A store of data that continues to exist when the program or computer is no longer running
What are the 6 string handling operations?
Concactenation
Length
Index
Substring
Convert
Conversion
What does ord() and chr() do?
Ord() converts a character to ASCII
Char() converts an ASCII code to a character
What is a subroutine?
A small subsection of the whole program that performs a specific task.
What are the benefits of a subroutine?
Each subroutine can be give to a different programmer inviting teamwork
Subroutines can be separately tested without waiting for the whole program to finish
Subroutines that are commonly used can be reused
What is a parameter and calling?
A piece of data that is passed into a subroutine in order for the subroutine to do its job.
Calling is a process where an instruction tells another named part of the code to run
What is the return command in a function?
A command in which a subroutine passes a piece of data back to the line of code from which it was called
What is modularisation?
The process of breaking a program into smaller parts called modules
What is a robust program?
A robust program continues to function even when confronted with unexpected events, such as a lost network connection or user inputting data the wrong data type
What is secure programming?
A secure program prevents users from accessing or altering data that they should not access or alter. Usernames and passwords make up one approach for keeping a program secure
What is a validation algorithm?
Ensuring that data entered into the computer is reasonable and sensible.
What is a range check?
Ensuring that data entered is within a specific numerical value range
What is a type check?
Ensures that the correct data type has been entered
What is a length check?
Ensures that a string contains a valid number of characters