cs159exam2

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

precedence first to last of == % || &&

% == && ||

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

false

a terminal semicolon after an if condition is optional

false

a terminal semicolon after an if logical expression is optional

false

all functions that utilize pass by address must be void functions

false

all while loops can be converted into for loops

false

each switch case label is the keyword case followed by a constant expression inside of single quotes

false

in this course you will be expected to validate for the input of both the range of acceptable values and the correct data type

false

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

false

it is not possible to redirect output to an existing file

false

it is not possible to replace an existing output file using redirection

false

selection is not used with input validation because it provides only a finite number of opportunities for the user to input data

false

the actions found inside the body of a pretest loop will be executed at least one time

false

the number of updates to the loop control variable always equals the number of loop iterations in a pretest looping construct

false

the only way to stop a program caught in an infinite loop is to shut down your terminal sofware

false

the parentheses around the logical expression of an if statement are optional

false

the parenthesis around the logical expression of an if statement are optional

false

the update expressions of a for loop may only make use of the addition or subtraction operator (++, --, +=, -=, +, -)

false

when the final (base case) recursive function call terminates the program will return to the main function

false

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

false

you can declare and initialize a variable in the first expression of a for loop

false

you will be expected to validate for the input of both the range of acceptable values and the correct data type

false

recursion is acceptable with either event-controlled or counter-controlled processes

false- counter controlled only

each time a recursive function call is made the current function starts over

false- new function call created. not repeated in sense of a loop

the short-circuit method is not applied to logical expressions found in conditional expressions

trie

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

tru

A function that calls itself is referred to as a recursive function

true

a dangling else logical error can be avoided through the use of { and } with all nested if/else constructs

true

a large number of recursive function calls may result in a segmentation faults (running out of available memory)

true

a limited amount of control structures are permissible in the main function to ensure that it is the main function which makes most of the function calls for a program

true

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

true

a solution that makes use of function calls to repeat instructions is referred to as recursive

true

a solution that makes use of loops to repeat instructions is referred to as iterative

true

according o the course standards a for loop should only be used with counter controlled processes

true

according to course standards if all three expressions are not needed in a for loop then you should instead make use of a while loop for your pretest looping needs

true

an infinite loop is a logical error

true

course standards prohibit the use of break to terminate any repetition construct

true

data in a file is read into a program when redirected from an external file in order from left then right and top then down

true

input validation is an example of an event-controlled problem

true

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

true

it is expected for most cases that the code for the validation of input be found in the same function that contains the prompt for input and scanf statement

true

no two switch case labels can represent the same constant expression value

true

one approach to potentially make solving problems that require nested loops easier is to separate each repetitive process into its own function

true

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

true

recursive functions can be either void or may return a value

true

selection is not used with input validation because it provides only a finite number of opportunities for the use to input valid data

true

selection is not used with input validation because it provides only a finite number of opportunities for the user to input valid data

true

the * and & operators are inverse operations of eachother

true

the compiler will issue a warning when an assignment operator rather than the equality operator is used in the logical expression of an if condition

true

the condition that results in an additional recursive function calls is known as the recursive case

true

the condition that results in no additional recursive function calls is known as the base case

true

the conditional expression has three operands and two operators

true

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

true

the initialization of loop control variable must take place outside (before) a pretest loop

true

the initialization of the loop control variable may take place inside the body of a post-test loop

true

the loop control variable is commonly a part of the loop control expression and the recipient of the actions of the loop update

true

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

true

the number of times the loop control expression is evaluated equals the number of iterations in a post test loop

true

the number of times the loop control expression is evaluated equals the number of iterations in a post-test loop

true

the short-circuit method is applied only to logical expressions in if/else if conditions

true

the short-circuit method is not applied to logical expressions used as loop control expressions

true

the update action for the loop control variable may be a part of the loop control expression in a loop

true

the update to the loop control variable is responsible for terminating the loop because it will eventually result in the loop control expression in being false

true

to append output to a file using redirection requires the use of two greater than characters

true

to implement repetition through the use of loops is known as an iterative solution

true

when redirecting output it is all generated output that is sent to the external file

true

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

x++, ++x, and x = x +1 are the same

true

you can 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

you can determine if any parameters are passed to a function by address from an example call to the function

true

you can determine if any parameters are passed to a function by address from the declaration statement of the function

true

you can make use of x++, ++x, x +=1 and x=x+1 interchangeably as the update expression of a for loop to increment the loop control variable

true

Its required to redirect input when you intend to redirect output

false

According to the course standards if all the expressions are not needed in a for loop then it is expected that you leave such an expression blank

false


Kaugnay na mga set ng pag-aaral

8B - The house (rooms and parts of the house)

View Set

Lecture 3b: Diagnostic Drops, Cyclo-refraction, Presbyopia, and Potential Acuity

View Set

Exam 3 Biology HW and practice test questions

View Set

Intro to Accounting Chapter 21 Smartbook

View Set