2.2 programming fundamentals Flashcards

(40 cards)

1
Q

What is an integer?

A

A whole number

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

What is real?

A

A number with decimals

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

What is boolean?

A

True or false

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

What is a character?

A

A letter, number or symbol in the given character set.

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

What is casting?

A

Changing the data type of a piece of data from one type to another.

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

What is a string?

A

A sequence of characters

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

What are the 3 programming constructs?

A

Sequence, selection and iteration

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

What is sequence?

A

All lines are executed

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

What is a selection?

A

Decisions made that determine the execution

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

What is iteration?

A

Code is repeated (‘looped’) until specified conditions are met.

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

What are the 2 types of iteration?

A

Count controlled loop

Condition loops

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

What is a variable?

A

a named data location in a program for a value that can be change during the program.

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

What is a constants?

A

They are named data which value remains the same throughout the program.

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

what does == mean?

A

equal to

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

what does != mean

A

not equal to

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

What does < mean?

A

Less than

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

What does <= mean?

A

less than or equal to

18
Q

What does > mean?

19
Q

What does >= mean?

A

Greater than or equal to

20
Q

What does * mean?

21
Q

What does / mean?

22
Q

What does MOD mean?

A

Modulus - outputs the remainder

23
Q

What does DIV mean?

A

Quotient - divides but ignores the remainder only outputting the whole number.

24
Q

What does ^ mean?

A

To the power of…

25
What is an assignment?
Giving a variable or constant a value
26
What is the advantage of using a constant?
It makes it easier to read the program and leads less chance of errors.
27
What are the 3 Boolean operators?
NOT, AND, OR
28
What must strings be written inside?
"" quotation marks
29
What does x.upper mean?
All the characters will be uppercase
30
What does x.lower mean?
All the characters will be lower case
31
What does x.length mean?
Returns the number of characters of the string
32
What does x.left(i) and x.right(i)?
This extracts the first/last parts of the string.
33
What does a.substring(a,b) mean?
Extracting a string starting at position a with length b from the string.
34
What does Concatenate mean?
To join them to form another string. Using the "+"
35
What does slicing mean? (string manipulation)
allows programmers to select any character from a string.
36
What are some of the basic file handling operators?
Open Read Write Close
37
How do you open a file using file handling?
myfile = open("file.txt")
38
How do you read using file handling?
Oneline = myfile.readline()
39
How do you write in a file?
myfile= open("Hello".w)
40
How do you close a file using file handling?
myfile.close()