CS 159 Lab 5

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

1/29

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.

30 Terms

1
New cards

In downward communication it is only a copy of the data that is sent from the calling function to the called function

true

2
New cards

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

true

3
New cards

Given the address of a variable the called function can access and manipulate the value of a variable in the calling function

true

4
New cards

The called function must declare a special type of variable known as a pointer to store a memory address that is sent from the calling function

true

5
New cards

The asterisk (*) when used in a variable declaration indicates that such variables are not data variables but address (pointer) variables which can store the addresses of other variables in the program.

true

6
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

7
New cards

When only one data item needs to be returned to the calling function then we should use the standard return statement rather than passing a single parameter by address.

true

8
New cards

The scope of an object determines the region of the program in which it is visible (and defined).

true

9
New cards

A variable declared in the local declaration section of a function has a scope that extends until the end of that function.

true

10
New cards

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

true

11
New cards

It is poor programming style to reuse identifiers within the same scope.

true

12
New cards

A structure chart should be created after your program has been written.

false

13
New cards

Each rectangle on a structure chart represents the user-defined and standard library functions used in a program

false, not stdlib functions

14
New cards

No code is contained in a structure chart as it only demonstrates the function flow of the program.

true

15
New cards

A structure chart may show the data that is exchanged between functions.

true

16
New cards

Functional cohesion is a measure of how closely the processes in a function are related.

true

17
New cards

A function that does one and only one process is functionally cohesive.

true

18
New cards

It is a good design practice to limit user-defined functions to only a single task.

true

19
New cards

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

true

20
New cards

It is a good design practice to design a user-defined function such that it is testable apart from the rest of the program.

true

21
New cards

It is possible to determine if any parameters are passed to a function by address from the declaration statement of the function.

true

22
New cards

It is never possible to determine if any parameters are passed to a function by address from an example call to the function.

false; will have the & in front of the variable

23
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

24
New cards

A function that passes at least one parameter by address must pass them all by address

false

25
New cards

All functions that utilize pass by address must be void functions.

false

26
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

27
New cards

With the use of pass by address it is now permissible for a function to be written to complete several subtasks of the program.

false; of course not

28
New cards

When working with a parameter that has been passed by address it is unnecessary to use the & (address) operator in the scanf because the parameter already represents a memory location.

true

29
New cards

The * and & operators are inverse operations of each other.

true

30
New cards

& gets the address, * tells to store at that address

true