section 2-prgramming Flashcards

1
Q

languages

A

languages have functions that manually convert between data types (e.g string_to_int)

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

data types

A
integer = whole numbers only 
real(float) =numbers with decimals 
boolean = true or false values 
character = a single letter,number,symbol...
string = represents texts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

operations

A

+ addition - subtraction
*multiplication / division
div= whole number mod=remainder

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

assignment operator

A

the assignment operator arrow or = is used to assign values to to a variable

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

comparison operators

A

are things like equal to ,greater than….

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

data values

A

data values can be stores as constants or variables ,

constants and variables need to be declared before use

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

constants

A

a constant is assigned to a value at design time

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

variables

A

a variable on the other hand can be changed which therefore makes them more useful

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

strings

A

strings are a data type made up of characters ,when manipulating strings you start at 0

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

inputs

A

inputs can be received from many devices (keyboards ,mouses,webcam….)

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

outputs

A

outputs are typically displayed (monitors)

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

if statements

A

if statements allow you to check if a condition is true or false.
more complex if statements can be made by putting one if statement inside another one

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

else if statements

A

else if statements are used to check multiple conditions and if they give out different outputs

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

case statements

A

case statements can check is a variable have specific values

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

repeat until loop

A

controlled by a condition or until a condition is true, you get an infinite loop if the condition is never true.
(same as ado until loop)

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

while loops

A

while loops keep going while the condition is true .while loops are controlled by a condition at the start of the loop

17
Q

do-while loops

A

controlled by end of the loop.keep while if the condition is true

18
Q

for loops

A

for loops will repeat the code inside a fixed number of times.for loops are a type of definite iteration

19
Q

nested iteration

A

is typically having a loop inside another

20
Q

boolean operators

A

look in revisions guide!!!

21
Q

generating random numbers

A

random.int()

22
Q

random numbers

A

random numbers generate random selections(e.g stimulate a coin toss)

23
Q

using LEN()

A

the number of elements in an array can be found using the LEN() just like for strings

24
Q

arrays

A

arrays are a data structure that can store a group of data values of the came type ,under one name

25
Q

one-dimensional arrays

A

one-dimensional arrays are like lists
e.g creating arrays changing elements
retrieving elements number of elements

26
Q

creating arrays

A

start of with array name,assign and operator and putting data in [] with commas separating it

27
Q

retrieving elements

A

retrieving elements can be done by using the name of the array and elements position(starting at 0 not 1)

28
Q

changing elements

A

changing elements is done by reassigning the array position to a different data value

29
Q

two-dimensional arrays

A

two-dimensional arrays are like one-dimensional arrays where each element is also one dimensional arrays,you can change element the exact same way (using LEN())

30
Q

record

A

a record is a type of data structure like an array,it is used to store data,records can keep related info in one place

31
Q

fields

A

each item in a record is called a field ,but you cant add extra fields to a record as they have fixed sizes

32
Q

file handling

A

file handling allows for permanent data storage
you can open the file with the OPEN() function
you can close the file with the CLOSE() function
write can be written as WRITE() or WRITELINE() and vice versa with READ()

33
Q

ENDOFILE()

A

ENDOFILE() is a useful command that returns true if the cursor is at the end of the file

34
Q

subroutines

A

subroutines are a set of instructions stored under one name and it helps to avoid repeating codes.the actual values that the parameters take when the subroutine is called are sometimes named arguments.can be rep

subroutines can be repeated and are very reliable
subroutines that return values are called functions

35
Q

parameters

A

parameters are special variables used to pass values into a subroutine. for each parameter you can specify name, data….

36
Q

local variables

A

local variables can only be used within the structure they’re declared in (they have a local scope)

37
Q

global variables

A

global variables can be used anytime after their declaration (they have global scope)