CS 159 Exam 2 True/False

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/34

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

35 Terms

1
New cards

A function that accomplishes multiple processes is functionally cohesive.

False

2
New cards

One benefit of pass by address is that it allows multiple changes to be made in a function and to have those changes available in the calling function.

True

3
New cards

It is not possible to access a variable in the calling function by its identifier when inside the called function.

True

4
New cards

It is possible to determine if any parameters are passed to a function by address based on the first line of the definition of the function (also known as the function header).

True

5
New cards

Not every function that utilizes pass by address are necessarily void functions.

True

6
New cards

Objects with a global scope are visible (defined) everywhere in the program.

True

7
New cards

It is a good design practice to repeat the logic of one function in other functions of the program.

False

8
New cards

In downward communication it is only a copy of the data that is sent to the function.

True

9
New cards

No code is contained in a structure chart and only demonstrates the function flow through the program.

True

10
New cards

The asterisk has two different uses, declaring an address variable (pointer) and indirectly accessing the data (in the memory location to which the variable points).

True

11
New cards

Evaluate the following expression: 8 + 3 && 0 - 7

True

12
New cards

(a != 0) and !!(a != 0) are complementary logical expressions (the variable a is an integer).

False

13
New cards

Given x = -5 and y = 3 the following expressions generate the same result: (x > 0 && x < 10 || y != 0) (x <= 0 || x >= 10 && y == 0)

True

14
New cards

The complement of x >= 3 is x < 3

True

15
New cards

Evaluate the following expression: 0 && 3 || 6

True

16
New cards

The short-circuit method of evaluating logical expressions is only relevant to those expressions that make use of at least one logical operator.

True

17
New cards

It is a course standard to make use of { and } with all if-else constructs.

True

18
New cards

(a != 0) and (a) are equivalent logical expressions (the variable a is an integer).

True

19
New cards

The complement of x > 3 is x <= 3

True

20
New cards

There is a required semi-colon that follows the logical expression of an if...else construct.

False

21
New cards

The conditional expression has three operands and two operators.

True

22
New cards

When the selection is based on a range of values, or the condition is not integral, we use the else-if for our multiway selection needs.

True

23
New cards

It is a logical error to associate two switch case labels with a common set of actions.

False

24
New cards

The course standards limit the use of the break statement to only switch statements.

True

25
New cards

When the statements associated with one case have been executed the program flow continues with next statement following the end of the switch construct.

False

26
New cards

The control expression that follows the keyword switch may be an integer or character expression.

True

27
New cards

The case label represents an integral type that is a possible result of the control expression.

True

28
New cards

The maximum number of actions that can be associated with a switch case label is one.

False

29
New cards

An iteration is one evaluation of the loop control expression.

False

30
New cards

Control structures are not to be found in the main function.

False

31
New cards

In a post-test loop the minimum number of times that the statements found inside of the loop are executed is one.

True

32
New cards

The initialization of the loop control variable must take place outside the body of a post-test loop.

False

33
New cards

The variable that receives the initialization action is not a part of the loop control expression.

False

34
New cards

A nested loop is a repetitive process contained inside of another repetitive process.

True

35
New cards

Input validation is an example of a counter-controlled problem.

False