1/68
test
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is the correct conditional statement to determine if x is between 19 and 99?
(x >= 19 && x <= 99)
The braces for a loop define the ________ of the loop.
body
In a compound logical and (&&) expression, the evaluation of the expression stops once
one of the terms of the expression is false. This is known as ________ evaluation
Short circuit Evaluation
________ is the decimal number associated with the ASCII character '0'
48
A loop that always executes the loop body at least once is known as a ________ loop.
do while
The format specifier used to tell printf to expect a double precision floating point number
is a percent sign followed by the character(s)
lf
Each time a loop body executes is known as an
iteration
if-else statements that are inside other if-else statements are said to be
nested
When must we use braces to define the body of a conditional expression?
more then one statement
int myValue; is called a ________.
Integer
The portion of the printf function call within the double quotes is called the
format string
________ is the decimal number -42 converted to an 8 bit binary number using 2's
complement notation.
10101111
What is the opposite of ( x < 20 && x > 12)?
(x>= 20 || x <= 12)
Is printf used for input or output?
output
Write the loop condition to continue a while loop as long as x is negative.
x < 0
________ is the decimal number 42 converted to an 8 bit binary number using 2's
complement notation.
0101010
A switch statement variable must be ________.
int type
________ is a type whose values are defined by a list of constants of type int
Enum
A loop that iterates one too many or one too few times is said to be
Off by one error
A ________ loop always executes the loop body at least once, regardless of the loop
condition.
do while
The code following the ________ case is executed if none of the other cases are matched in
a switch statement.
default
Variables defined inside a set of braces are said to be ________ to that block of code
local
A ________ expression is an expression that can be thought of as being true or false.
boolean
The format specifier used to tell scanf to expect a double precision floating point number is
a percent sign followed by the character(s) ________.
%lf
Each repetition of a loop body is called ________.
iteration
A compound statement that contains variable declarations is called a ________.
block
The compiler always pairs an else with ________.
most previous
unmatched if
Converting from one type to another is called
type casting
Write the code to convert the value in an integer variable named count to a temporary
double
(double) count
Algorithms are typically described in
pseudocode
When you want to execute a function in your program, you would make a function
call
The ________ of a variable is where that variable can be used
scope
In the following function declaration, the variable size is known as a ________.
int myFunction ( int size);
formal parameter
Constant variables that might be used in different functions should be
global
The absolute value function abs is located in the ________ library
stdlib.h
Variables that are declared inside a function are said to be ________ to that function
local
#include math.h is known as an
include directory
problem solving approach that starts with the big problem and breaks it down into
smaller pieces is called
top down design
The black box analogy demonstrates the concept of
procedural abstraction
What is the output produced by the following code fragment?
int i 3;
printf("%.2f\n", sqrt( pow(i,4.0) ) );
9
What is the value of (pow(2,sqrt(9.0) ceil(0.99)))?
16
When the address of the actual argument is passed to the formal parameter, this allows us
to mimic a parameter passing mechanism called ________.
Pass by reference
Using functions in a program is called
procedural abstraction
What is the correct way to call the following function?
void setDisplay( void );
setDisplay();
The items passed to a function are called
arguments
The & operator is called the ________ operator.
address of
If we want to test if a given function works correctly, we would write a ________ to test it
driver
A ________ is a main program that only checks that functions execute correctly
driver
A ________ is a simplified version of a function used to test the main program
stub function
What type of value does a void function return?
none
Testing a program with values that are close to values that will change the execution of a
program is called ________.
boundary testing
The values or variables listed in the function declaration are called ________ to the
function.
formal parameters
What symbol is used to signify that a parameter is a pointer?
*
What is the most appropriate way to call the doThings function? Assume that you have
two variables named var1 and var2 defined as follows.
int var1;
float var2;
void doThings(float x, int y);
doThings(var2, var1);
Pre and post conditions for a function should be written (before/after) the function
definition is written.
before
The function used to open a file and return a FILE pointer for that file is ________.
fopen
When a file fails to open, fopen returns or evaluates as ________.
Null
The format specifier to display floating point numbers in scientific notation is the percent
sign followed by the letter: ________
%e
The format specifier that always shows the decimal point to display floating point numbers
is the percent sign followed by the letter
f
"\n" is a ________ and '\n' is a ________.
C string, single char
Write the format specifier used to change the number of decimal places displayed in a
floating point number to 3 decimal places.
%.3f
Which functions read one character even if that character is a blank space?
fgetc, getc, getchar
The format specifier to display floating point numbers in the shortest notation is the
percent sign followed by the letter: ________
%g
When you are finished using a file you should close the file using the function
fclose
________ is the safe function used to get a restricted length c string from a file or the
keyboard.
fget_s
The special character used to mark the end of a C string is called the ________ character
null terminator
scanf, fscanf and sscanf return ________ or ______.
NOC or EOF
All data is input and output as ________ data.
binary