CS 159 Final True/False
A function that passes at least one parameter by address must pass them all by address.
F
A scanf function is composed of a format string and a data list
F
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
A structure chart should be created before your program has been written.
F
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
All functions that utilize pass by address must be void functions
F
Each rectangle on a structure chart represents only the standard library functions used in a program.
F
In additional to alphabetic and digit characters, it is acceptable to use underscores, dashes, and periods as part of an identifier.
F
Parameters being received by a function will be commented to the right of where they are defined.
F
The control of the program always returns from the calling function to the main function
F
The first line of the function definition terminates with a semicolon (;)
F
The function call requires the data types and identifiers for each parameter.
F
The function declaration requires the data types and identifiers for each parameter
F
The precision modifier can specify the number of digits to display on both sides of the decimal-point with a floating-point value
F
The return statement cannot contain an expression.
F
The return statement in main will return control back to the first statement in main.
F
The use of a precision modifier when displaying a floating-point value will result in truncating all digits beyond the specified precision value.
F
With the use of pass by address it is now permissible for a function to be written to complete several sub-tasks of the program.
F
You should declare multiple variables on one line
F
A C program begins with a section for preprocessor directives
T
A dangling else logical error can be avoided through the use of { and } with all nested if/else constructs.
T
A function header comment for every user-defined function must be inserted immediately above the definition of the function it is documenting.
T
A function may return at most one value.
T
A function that does one and only one process is functionally cohesive.
T
A literal constant is data that is not represented by any other symbol in a give expression
T
A local variable cannot be referenced through its identifier outside of the function for which it is defined.
T
A printf function is composed of a format string and a data list
T
A program that does not compile cannot be successfully submitted for grading
T
A single-type operation will generate a result of that same type.
T
A structure chart may show the data that is exchanged b/w functions
T
A user-defined function may be called more than once in a program.
T
A variable declared in the local declaration section of a function has a scope that extends until the end of that function.
T
A variable that is not initialized at the time it is declared will be storing an unknown value.
T
A width modifier is used to reserve a given number of spaces to assist with the alignment of the value being displayed
T
Additional local variables can be defined in the local declaration section of a function.
T
All code found between { and } should be indented two additional spaces.
T
All of the compound assignment operators share the same level of operator precedence
T
An explicit type conversion can be used to temporarily alter the data type in an expression from its declared type.
T
An identifier cannot begin with a digit character
T
Any compiler warnings remaining in a submission will result in a loss of points
T
Comments are added to a program to improve its level of documentation intended for other programmers.
T
Converting a higher ranked data type of that of a lower ranked data type may result in the loss of data.
T
Data sent from the calling function to the function being called will be received in the same order in which it was passed.
T
Do not single (or double) space the entire program, use blank lines when appropriate.
T
Every program must have exactly one function named "main"
T
Functional cohesion is a measure of how closely the processes in a function are related.
T
Given the address of a variable the called function can access and manipulate the value of a variable in the calling function.
T
In downward communication (passing by value) it is only a copy data that is sent from the calling function to the called function.
T
In most cases the definition of symbolic/defined constants will not terminate with a semi-colon
T
Individual tasks in a program must be factored into individual.
T
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
It is a good design practice to limit user-defined functions to only a single task
T
It is a good design practice to not repeat the logic of one function in other functions of the program.
T
It is not possible to access a variable in the calling function by its identifier when inside the called function.
T
It is poor programming style to reuse identifiers within the same scope.
T
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).
T
It is possible to determine if any parameters are passed to a function by address from an example call to the function.
T
It is possible to determine if any parameters are passed to a function by address from the declaration statement of the function.
T
Multi-line comments cannot be nested
T
No code is contained in a structure chart and only demonstrates the function flow through the program.
T
Objects with a global scope are visible everywhere in the program.
T
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.
T
One benefit of user-defined functions is the potential reduction or elimination of duplicate code.
T
Parameters are defined as local variables in the function header and should not be re-defined within the local declaration section of the function.
T
Rarely are single character identifiers considered meaningful for variables in a program.
T
Rather than passing the only parameter by address to a void function it is better to make use of the return statement in the function to send the needed value to the calling function.
T
Select meaningful identifier (names) for all variables in your program.
T
The C language uses only pass by value and return to achieve communication of data between a calling and a called function.
T
The asterisk (*) in a variable declaration indicates that the variables are not data variables but address variables holding the addresses of other variables in the program.
T
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).
T
The course program headers are multi-line comments
T
The data type of a variable will determine the amount of memory that is necessary to reserve for it
T
The file stdio.h and math.h are libraries that contain standard functions for our use.
T
The file you submit for lab#1 must be named lab01.c
T
The function call is an executable statement
T
The function definition contains executable statements that perform the task of the function.
T
The function definition requires the data types and identifiers for each parameter.
T
The implementation of advanced concepts, those yet to be introduced in lecture, is not permitted in an assignment unless otherwise specified
T
The individual task represented by a function should be testable apart from the rest of the program.
T
The main function is the starting point for execution of the program.
T
The operators that can be applied to a value are restricted by its data type
T
The preprocessor is a part of the compiling process and prepares your code for the remainder of that process
T
The result of an expression is undefined when it attempts to modify a single variable more than once.
T
The return 0; statement will be the final statement in the main function
T
The role of the main function is to coordinate the function calls and to establish the data needs for a program.
T
The scope of an object determines the region of the program in which it is visible.
T
The selection of a conversion code in a format string depends on the type of value it will represent
T
The statements found inside of an if...else may include another if...else construct.
T
The use of literal constants should be minimized and the use of symbolic/defined constants should be maximized in your porgram
T
The use of symbolic/defined constants can improve the documentation of a program
T
The value of a local variable may be returned through a return statement of a user-defined function
T
There is no need to include example output with your submission.
T
To obtain the address of a variable we use the address operator (&).
T
To store a memory address that is sent from the calling function, the called function should use a special type of variable known as a pointer
T
Variable declarations will NEVER be permitted in the global section this semester.
T
When evaluating an operator with mixed-type operands it is the lower ranked data type that is converted to that of the higher ranked data type.
T
When only one data item needs to be returned we should use the standard return statement.
T
While commonly used in a printf function the scanf function would not make use of the '\n' character
T
Within each function the local declarations and executable statements must NOT be permitted to overlap.
T
You should place a single space between all operators and operands
T
