Programming Constructs Flashcards

PIGClan

1
Q

What is a variable

A

named location in computer memory used to hold data when program is running
value of a variable can change when program is running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a constant

A

named location in computer memory used to hold data when program is running
value of constant remains same while program is running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Boolean operator

A

Operator that allows conditions to be combined and then evaluated: the outcome is a Boolean variable.
AND OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an Arithmetic operator

A

enables arithmetic operations to be carried out on variables:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are the arithmetic operators

A

+, -, *(multiply), / (divide)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an input statement

A

statement used to capture data which is to be used in the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Whats an output statement

A

statement used to output data and info from program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

whats an assignment statement

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what are some of the key features of programming constructs

A

Variable
Constant
Boolean Operator
Arithmetic operator
input statement
Output statement
Assignment Statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Whats a sequence

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is selection

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is iteration

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a One-dimensional array

A

Array is a data structure holds a set of data items of same data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

key facts about arrarys

A

Computer reserves a set of memory locations one for each element in the array.
In many programming languages arrays are zero-indexed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a string

A

Data containing text, letters or a mixture of letters and numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the Len() string function

A

ensures string is of a certain lengthh

17
Q

what is the upper() string function

A

ensures all letters inputted are in caps

18
Q

what is basic file handling functions

A

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