2.2 programming fundamentals Flashcards

You may prefer our related Brainscape-certified flashcards:
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?

A

more than

19
Q

What does >= mean?

A

Greater than or equal to

20
Q

What does * mean?

A

Multiple

21
Q

What does / mean?

A

divide

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
Q

What is an assignment?

A

Giving a variable or constant a value

26
Q

What is the advantage of using a constant?

A

It makes it easier to read the program and leads less chance of errors.

27
Q

What are the 3 Boolean operators?

A

NOT, AND, OR

28
Q

What must strings be written inside?

A

”” quotation marks

29
Q

What does x.upper mean?

A

All the characters will be uppercase

30
Q

What does x.lower mean?

A

All the characters will be lower case

31
Q

What does x.length mean?

A

Returns the number of characters of the string

32
Q

What does x.left(i) and x.right(i)?

A

This extracts the first/last parts of the string.

33
Q

What does a.substring(a,b) mean?

A

Extracting a string starting at position a with length b from the string.

34
Q

What does Concatenate mean?

A

To join them to form another string. Using the “+”

35
Q

What does slicing mean? (string manipulation)

A

allows programmers to select any character from a string.

36
Q

What are some of the basic file handling operators?

A

Open
Read
Write
Close

37
Q

How do you open a file using file handling?

A

myfile = open(“file.txt”)

38
Q

How do you read using file handling?

A

Oneline = myfile.readline()

39
Q

How do you write in a file?

A

myfile= open(“Hello”.w)

40
Q

How do you close a file using file handling?

A

myfile.close()