Programming Constructs Flashcards
PIGClan
What is a variable
named location in computer memory used to hold data when program is running
value of a variable can change when program is running
What is a constant
named location in computer memory used to hold data when program is running
value of constant remains same while program is running
What is a Boolean operator
Operator that allows conditions to be combined and then evaluated: the outcome is a Boolean variable.
AND OR
What is an Arithmetic operator
enables arithmetic operations to be carried out on variables:
what are the arithmetic operators
+, -, *(multiply), / (divide)
What is an input statement
statement used to capture data which is to be used in the program
Whats an output statement
statement used to output data and info from program
whats an assignment statement
statement that assigns a value to a variable, constant or other data structure: value on the right-hand side of an assigned statement can contain a calculation
what are some of the key features of programming constructs
Variable
Constant
Boolean Operator
Arithmetic operator
input statement
Output statement
Assignment Statement
Whats a sequence
denotes order in which instructions are carried out by computer. simplest programs run from beginning to end and each statement carried out one after the other in sequence
What is selection
sequence of instructions within a program can be changed based on the value of variables within that program. this means that certain statements are selected based on a value. Achieved through IF statements and Boolean operators
What is iteration
Another word for repetition
Repetition is used when a section of code is to be carried out more than once.
Repetition comes in two forms unconditional and conditional
What is a One-dimensional array
Array is a data structure holds a set of data items of same data type
key facts about arrarys
Computer reserves a set of memory locations one for each element in the array.
In many programming languages arrays are zero-indexed
What is a string
Data containing text, letters or a mixture of letters and numbers
What is the Len() string function
ensures string is of a certain lengthh
what is the upper() string function
ensures all letters inputted are in caps
what is basic file handling functions
Close - closes csv file and saves the data
Open - opens csv file for use
Read - allows csv file to be read from and data used
Write - overwrites any old data in csv file and replaces it
append - adds new data to old data in csv file