Programming concepts Flashcards

1
Q

Programming data types

A
INTEGER
STRING
REAL
CHAR
BOOLEAN
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

INTEGER

A

Stores a whole number

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

STRING

A

Stores zero or more sequence of characters

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

REAL

A

Stores integers and numbers with a decimal part

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

CHAR

A

Stores a single character

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

BOOLEAN

A

Stores only 2 possible values

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

variable

A

named memory location that can store a value

value can change whilst the program is running

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

constant

A

named value

cannot change whilst program is running

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

Advantages of constants

A
  1. code will be easier to read and understand (constant’s identifier will be used instead of a number)
  2. you only have to edit in one place.
  3. value cannot be accidentally changed during the running of the program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

counting

A

count the number of items in a list
incremented by 1

count ← count + 1

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

totalling

A

sum a list of numbers
each value is added to a running total

total ← total + value

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

sequencing

A

idea of one statement or instruction being executed one after another

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

selection

A

decides which statements are executed based on a condition

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

2 conditional statements(selections)

A

IF … THEN … ELSE … ENDIF

CASE … OF … OTHERWISE … ENDCASE

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

CASE … OF … OTHERWISE … ENDCASE

A

A statement that allows for multiple selections/deals with many possible outcomes

simplifies pseudocode and make it easier to read

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

IF … THEN … ELSE … ENDIF

A

A conditional statement with different outcomes for true and false

17
Q

Loop(iteration structures)

A

FOR … TO … NEXT
WHILE … DO … ENDWHILE
REPEAT … UNTIL

18
Q

FOR … TO … NEXT

A

loop that will iterate a set number of times

Used when you know how many times you want to iterate

19
Q

WHILE … DO … ENDWHILE

A

condition-controlled loop
Condition is checked at the start of the loop
code inside the loop may therefore not execute
Used when you do not know how many times to iterate

20
Q

REPEAT … UNTIL

A

condition-controlled loop
Condition is checked at the end of the loop
code inside the loop will always execute at least once
Used when you do not know how many times to iterate

21
Q

Array

A

e.g. data structure
Collection of variables of the same data type
Referred to by a single name (identifier)
Each element is accessed by an index (position)

22
Q

4 advantages of an array

A
  1. can store multiple values under a single identifier
  2. reduces the number of variables
  3. can use iteration to loop through an array
  4. allows for more efficient programming