Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What can a program do?

A

-Read input
-Store data
-Calculate
-Write Output
-Iterate or Loop
-Compare and branch
-Sequence

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

What is pseudocode?

A

semi-programme language used to describe steps in an algorithm.

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

What is flow chart?

A

graphical representation of a programme

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

What is interactive mode Programming ?

A

mode that can be directly typed and the interpreter displays the results immediately

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

What is script mode programming?

A

test file containing Python statements. They are reusable

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

What is input data?

A

Input data is data needed to solve the problem

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

What is output data?

A

The resulting information

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

What are the three types of error?

A

Syntax Error
Runtime Error
Logical Error

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

Explain Syntax error

A

-code violating Python language
-Interpreter specifies the problem

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

Explain Runtime Error

A

-Program encounters unexpected conditions during execution
-e.g. division by zero
calling function that not exist

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

Explain Logical Error

A

-produces incorrect results
- incomplete understand about the problems

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

Two repetition in Python

A

Condition controlled structure (while)
Counter control structure (for)

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

Explain condition controlled (while)

A

-loop must be a statements
-use boolean expression

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

Explain count controlled (for)

A

-loop must be numbers

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

for loop vs while loop

A

“for” loop
-number of loops is known
-can have counter variables
-lop infinite times if not specified

“while” loop
-number of loops is unknown
-no control variable
-loop infinite until condition is met
-if condition not specified, it will shows error

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

Logical Operators vs Relational Operators

A

Logical Operators
-comparison between two logical expressions
-e.g. “and, or, not”

Relational Operators
-comparison between two expressions
-e.g.”>,<,<=,>=,==,!=”

17
Q

Types of control structure

A

Selection control structure
Repetition control structure