EECS 600SC 2012[10](01-05) Flashcards

(19 cards)

1
Q

What is the difference between declarative and imperative knowledge?

A

Declarative knowledge is statements of fact; imperative knowledge is “how to” knowledge.

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

What is the advantage of a stored-program computer?

A

It’s far more versatile than a fixed-program computer, since it interprets a program given to it and carries out those instructions, as opposed to being built to do one thing.

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

What are the syntax, static semantics, and semantics of a language?

A

Syntax determines whether a string is legal, static semantics determine whether the string has meaning, and semantics assigns a meaning to a legal sentence (assuming no static semantic errors).

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

What sorts of errors can occur in a program?

A

It can crash, run forever, or give a wrong answer.

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

What is a ‘type’?

A

Types are classifications of objects, which is what Python, as an OOP language, deals with. They determine how those objects are dealt with (for example, adding two integers results in an integer, two strings results in a concatenated string, and an integer and a string results in an error).

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

What is an ‘expression’?

A

An expression is composed of objects (or operands) and operators, and can be interpreted into a value.

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

What is a type conversion?

A

A type conversion turns one type of object into another. For example, applying str to the integer 3 results in the string ‘3’.

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

What is a keyword?

A

Keywords are words that have special meanings within a language. Many editors will display them in special colors. These words cannot be used as variables.

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

What is the difference between a straight line program and a branching program?

A

A straight line program simply goes through and carries out each step. A branching program will do different things depending on conditions set within the program.

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

What is a conditional?

A

A conditional statement starts with an if statement, and can also include elif and else statements.

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

What does it mean for a program to terminate?

A

Either the program will return a value, or throw an exception. A program that does not terminate runs indefinitely, typically because it’s gotten stuck in a loop.

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

What is a for loop?

A

A for loop takes some sort of iterable object (a list, tuple, or string) and performs its function once for each item in that object. Any function that depends on the input can have a different result at each step, since the input is the current item.

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

What is decomposition?

A

Decomposition breaks a problem into self-contained, manageable parts.

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

What is abstraction?

A

Decomposition breaks a problem into self-contained, manageable parts.

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

What is the difference between formal and actual parameters?

A

Formal parameters are the names of variables used inside a procedure; actual parameters (or arguments) are the values assigned to those names.

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

What is mutability?

A

A mutable object’s values can be changed; we must be careful when working with mutable objects not to inadvertently change them.

17
Q

What is the important difference between a list and a tuple?

A

Tuples are immutable (as are strings).

18
Q

What is cloning?

A

Cloning creates a copy of a mutable object, so that the values can be manipulated without mutating the original object.

19
Q

What are the important aspects of a dictionary?

A

A dictionary is mutable, with immutable keys, and unordered.