CSC 351 - Chapter 7 Flashcards

1
Q

expression

A

the fundamental means of specifying computations in a programming language

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

arithmetic expressions

A

consist of operators, operands, parentheses and function calls

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

unary

A

single operand

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

binary

A

two operands

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

ternary

A

three operands

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

infix

A

operators appear between their operands

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

prefix

A

operators precede their operands

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

operator precedence rules

A

define the order in which the operators of different precedence rules are evaluated. based on a hierarchy of operator priorities

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

identity operator

A

unary addition - usually has no associated operation therefore having no affect on its operand

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

associativity

A

when an expression contains two operators of the same precedence next to each other, the associativity rules of the language determine which operator gets evaluated first (common to go left to right)

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

parenthesis

A

can alter the precedence and associativity rules by being added to an expression

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

side effect

A

occurs when the function changes either one of its parameters or a global variable

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

referential transparency

A

occurs if any two expressions in the program that have the same value can be substituted for one another without affecting the program. adv: the semantics are much easier to understand

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

operator overloading

A

multiple use of an operator - acceptable as long as the readability nor reliability suffers

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

narrowing conversion

A

converts a value to a type that cannot store even approximations of all the values of the original type

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

widening conversion

A

converts a value to a type that can include at least approximations of all the values of the original type

17
Q

mixed-mode expression

A

languages that allow operators to have operands of different types

18
Q

relational operator

A

operator that compares the values of its two operands, the value of a relational expression is a boolean

19
Q

short-circuit evaluation

A

a result is determines without evaluating all of the operands and/or operators

20
Q

compound assignment operator

A

a shorthand method of specifying a commonly needed form of assignment

21
Q

coercion

A

an implicit type conversion that is initiated by the compiler

22
Q

Always does short-circuit evaluation

A

Ruby

23
Q

Allows the programmer to choose if they want to use short-circuit evaluation

A

Ada