What is variable?
Variable - A variable is a value stored in memory that can change while the program is running.
What is Casting and why might it be useful?
CAsting - Converting data types
This process is known as casting. The following examples convert a string to an integer and an integer to a string:
str(68) returns “68”
int(“54”) returns 54
float(“5.4”) returns 5.4
What are the five main data types?
Each data type is allocated a different amount of memory
Integer - A positive or negative whole number used when arithmetic will be required
Real / Float - A positive or negative decimal number
Character - A single alphanumeric
String - Multiple characters joined together [n.b. use this for credit card numbers]
Boolean - two inputs(true and false)
What is string manipulation?
word = “Hello World”
length = len(word) = 10
What is a constant?
Constant - A value which remains fixed as does not change whilst the program is running. It must be set at design time when the program is first written.
What is a sequence
Sequence is executing one instruction after another
What is Selection
Selection is program branching depending on a condition.
What is Iteration?
What are the 3 types of loops?
Iteration, sometimes called looping, is repeating sections of code.
What are the three common Boolean Operators?
What does casting allow for?
It allow Sub-programs to recieve data in the format they were expecting.
What is ASCII conversion?
What are the stages to write data to a file?
My
What are the stages to read data from a file?
What are records?
Data in data bases are stored as records.
Each records contains a number of fields and each field has its own data type
What is a record structure
A record structure:
How are records stored in text files?
How are records stored in Arrayas and Lists
• Stored in RAM.
• Used to store data when a program is running.
• Useful for small volumes of data an algorithm is using.
• Can be single or multi-dimensional allowing for tables of data to be
stored.
• Uses indexes to refer to data items.
• Efficient algorithms or linear searches can be used to find data
How are records stored in databases?
What is the records structure?
• Often stored on remote servers.
• Often used to store data shared by many users, e.g. ticket booking
system.
• Data is stored in records and fields.
• Uses advanced data structures to store data efficiently.
• Uses very efficient algorithms to search and sort data executed on
the servers.
• More secure than text files.
• The order of the fields in the database in independent of the code
What is SQL
There are three commands you need to know:
SQL is used to create, delete, modify and manipulate records in a database
The basic commands include:
What is an Array?
An array is a series of memory locations – each of which holds a single item of data, but with each location sharing the same name. All data in an array must be of the same data type
We can do that by allocating a contiguous part of memory to storing that data.
Our program will know where in memory out array starts.
It uses a index relative to this start point to allow us to easily access the arrays contents.
What are 1-dimensional Arrays?
What are two-dimensional Arrays?
You can visualise a two dimensional array as looking like a table with two sets of indexes. One index for the rows, another for the columns.
print(countries[0][0]) creates “Angola” and 1246700
What are the two types of sub programs
Procedures
Functions
What do sub-routines look like in flowcharts?