Back to marketplace

2.2 Programming Fundamentals

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What is variable?

Back (Answer)

Variable - A variable is a value stored in memory that can change while the program is running.

#2
Front (Question)

What is Casting and why might it be useful?

Back (Answer)

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

#3
Front (Question)

What are the five main data types?

Back (Answer)

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)

Card back image
#4
Front (Question)

What is string manipulation?

Back (Answer)

word = “Hello World” length = len(word) = 10 • *word[0:3]** = “Hel” • *word[-3:] = “rld”** • *print word[3:] = “lo World”** • *print word[:-3] #get all but the three last character​** • *word.upper() = “HELLO WORLD”** • *word.lower() = “hello world”**

Card back image
#5
Front (Question)

What is a constant?

Back (Answer)

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.

#6
Front (Question)

What is a sequence

Back (Answer)

Sequence is executing one instruction after another

Card back image
#7
Front (Question)

What is Selection

Back (Answer)

Selection is program branching depending on a condition.

Card back image
#8
Front (Question)

What is Iteration? What are the 3 types of loops?

Back (Answer)

Iteration, sometimes called looping, is repeating sections of code.

Card back image
#9
Front (Question)

What are the three common Boolean Operators?

Back (Answer)

Card back image
#10
Front (Question)

What does casting allow for?

Back (Answer)

It allow Sub-programs to recieve data in the format they were expecting.

Card back image
#11
Front (Question)

What is ASCII conversion?

Back (Answer)

Card back image
#12
Front (Question)

What are the stages to write data to a file?

Back (Answer)

• Open the file for creating/overwriting or appending to a file My • Write the data to a file • Close the file

#13
Front (Question)

What are the stages to read data from a file?

Back (Answer)

• Open the file for reading data • Assign a boolean variable to “false” to indicate the end of file is not reached. • While the end of the file is false and the search item is not found: • Read data from the file • If the data matches what is being searched for, assign the data to variables or output. • Check if the end of the file has been reached and assign the Boolean variable to “true” • Close the file

Card back image
#14
Front (Question)

What are records?

Back (Answer)

Data in data bases are stored as records. Each records contains a number of fields and each field has its own data type

Card back image
#15
Front (Question)

What is a record structure

Back (Answer)

A record structure: • A collection of related fields • Each field is a variable • Each field in a record can have a different data type.

Card back image
#16
Front (Question)

How are records stored in text files?

Back (Answer)

• Stored on the secondary storage • Used to store data when the application is closed. • Useful for small volumes of data. E.g. configuration files. • Each entry is stored on a new line or separated with an identifier such as a comma or tab. • Can require a linear search to find/read data which is slow (if there is no order to the data or record structure). • Structured text files E.g. CSV, XML & JSON are popular for storing and exchanging data between applications

#17
Front (Question)

How are records stored in Arrayas and Lists

Back (Answer)

• 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

#18
Front (Question)

How are records stored in databases? What is the records structure?

Back (Answer)

• 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

#19
Front (Question)

What is SQL

Back (Answer)

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: • SELECT which fields to be returned. * can be used to indicate all fields. • *- FROM which table. Databases can have more than one table, each with their own unique name.** • WHERE records meet a condition. Like can be used as a wildcard.

Card back image
#20
Front (Question)

What is an Array?

Back (Answer)

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.

#21
Front (Question)

What are 1-dimensional Arrays?

Back (Answer)

Card back image
#22
Front (Question)

What are two-dimensional Arrays?

Back (Answer)

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

Card back image
#23
Front (Question)

What are the two types of sub programs

Back (Answer)

Procedures • Carry out a task & DO NOT RETURN A VALUE • Provide structure to code making it easier to read Functions • Carry out a task AND Return a value • Create reusable program components

Card back image
#24
Front (Question)

What do sub-routines look like in flowcharts?

Back (Answer)

Card back image