CS 159 Exam 1 True and False

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/80

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:47 PM on 10/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

81 Terms

1
New cards

A C program begins with a section for preprocessor directives.

T

2
New cards

The preprocessor is a part of the compiling process and prepares your code for the remainder of that process.

T

3
New cards

Every program must have exactly one function named main.

T

4
New cards

Within each function the local declarations and executable statements must NOT be permitted to overlap.

T

5
New cards

Variable declarations will NEVER be permitted in the global section this semester.

T

6
New cards

The files stdio.h and math.h are libraries that contain standard functions for our use.

T

7
New cards

The return(0); statement will be the final statement in the main function.

T

8
New cards

The return statement in main will return control back to the first statement in main.

F

9
New cards

Comment are added to a program to improve its level of documentation intended for other programmers.

T

10
New cards

The course program headers are multi-line comments.

T

11
New cards

You should place a single space between all operators and operands.

T

12
New cards

All variables should be commented to the right of each declaration.

T

13
New cards

You should declare multiple variables on one line.

F

14
New cards

Select meaningful identifies (names) for all variables in your program.

T

15
New cards

Rarely are single character identifies considered meaningful for variables in a program.

T

16
New cards

Do not single ( or double) space the entire program. use blank lines when appropriate.

T

17
New cards

There is no need to include example output with your submission.

T

18
New cards

All code found between { and } should be indented two additional spaces.

T

19
New cards

Multi-line comments cannot be nested

T

20
New cards

An identifies cannot begin with a digit character.

T

21
New cards

In additional to alphabetic and digits characters it is acceptable to use underscores, dashes and periods as part of an identifier.

F

22
New cards

The data type of a variable will determine the amount of memory that is necessary to reserve for it.

T

23
New cards

The operators that can be applied to a value are restricted by its data type.

T

24
New cards

A variable that is not initialized at the time it is declared will be storing an unknown value.

T

25
New cards

The use of symbolic / defined constants can improve the documentation of a program.

T

26
New cards

In most cases the definition of symbolic/defined constants will not terminate with a semi-colon.

T

27
New cards

A literal constant is data that is not represented by any other symbol in a given expression.

T

28
New cards

A printf function is composed of a format string and a data list.

T

29
New cards

A scanf function is composed of a format string and a data list.

F

30
New cards

The selection of a conversion code in format string depends on the type of value it will represent.

T

31
New cards

A width modifies is used to reserve a given number of spaces to assist with the alignment of the value being displayed.

T

32
New cards

The precision modifier can specify the number of digits to display on both sides of the decimal-point with a floating point value.

F

33
New cards

A single scanf function call can be used to display the prompt for input to the user and accept the input from the user.

F

34
New cards

While commonly used in a printf function, the scanf function would not make use of the '\n' character.

T

35
New cards

The use of literal constants should be minimized and the use of symbolic/ defined constants should be maximized in your program.

T

36
New cards

A program that does not compile cannot be successfully submitted for grading.

T

37
New cards

Any complier warnings remaining in a submission will result in a loss of points.

T

38
New cards

The implementation of advanced concepts, those yet to be introduced in lecture, is not permitted in an assignment.

T

39
New cards

The function call is an executable statement.

T

40
New cards

The function declaration requires the data types and identifiers for each parameter.

F

41
New cards

The function call requires the data types and identifiers for each parameter.

F

42
New cards

The function definition requires the data types and identifiers for each parameter.

T

43
New cards

The function definition contains executable statements that perform the task of the function.

T

44
New cards

The first line of the function definition with a semicolon.

F

45
New cards

The value of a local variable may be returned through a return statement of a user defined function.

T

46
New cards

Parameters are defined as local variables in the function header and should not be redefined within the local declaration section of the function.

T

47
New cards

Additional local variables can be defined in the local decl

T

48
New cards

A local variable cannot be referenced through its identifier outside of the function for which it is defined.

T

49
New cards

A variable declared in the local declaration section of a function can have the same identifier as one of the parameters of the function.

F

50
New cards

Individual tasks in a program must be factored into individual user-defined functions.

T

51
New cards

One benefit of user-defined functions is the potential reduction or elimination of duplicate code.

T

52
New cards

A function header comment for every user defined function must be inserted immediately above the definition of the function it is documenting.

T

53
New cards

Parameters being received by a function will be commented to the right of where they are defined.

F

54
New cards

The return statement cannot contain an expression.

F

55
New cards

Data sent from the calling function to the function being called will be received in the same order in which it was passed.

T

56
New cards

The individual task represented by a function should be testable apart from the rest of the program.

T

57
New cards

A user-defined function may be called more than once in a program.

T

58
New cards

The control of the program always returns from the calling function to the main function.

F

59
New cards

A function mat return at most one value.

T

60
New cards

The role of the main function is to coordinate the function calls and to establish the data needs for a program.

T

61
New cards

In downward communication ( passing by value) it is only a copy of the data that is sent from the calling function to the called function.

T

62
New cards

The C language uses only the return statement to achieve communication of data between a calling and a called function.

F

63
New cards

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

T

64
New cards

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

T

65
New cards

To store a memory address that is sent from the calling function, the called function should use a special type of a variable known as pointer.

T

66
New cards

To obtain the address of a variable we use the address operator (&).

T

67
New cards

The asterisk (*) in a variable declaration indicates that the variable are not data variables but address variable holding the address of other variables in the program.

T

68
New cards

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

T

69
New cards

The scope of an object determines the region of the program in which it is visible.

T

70
New cards

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

T

71
New cards

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

T

72
New cards

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

T

73
New cards

A structure should be created before your program has been written.

T

74
New cards

Each rectangle on a structure chart represent only the standard library functions used in a program.

F

75
New cards

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

T

76
New cards

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

T

77
New cards

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

T

78
New cards

A function that does one and only one process is functionally to only a single task.

T

79
New cards

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

T

80
New cards

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

T

81
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.

T