CSCI 1410 Exam 1

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

False

CH4- x >= y is the same as (x > y ** x = y)

False

CH6- All static local variables are initialized to -1 by default.

True

CH6- Function prototypes are terminated with a semicolon.

True

CH6- Functions should be given names that reflect their purpose.

True

CH6- In a function prototype, the names of the parameter variables may be left out.

True

CH6- Overuse of global variables can lead to problems.

True

CH7- To use a vector, you must include the vector header file.

column

CH7- When a two- dimensional array is passed to a function the ____ size must be specified.

False

CH7- When an array name is used without brackets and a subscript, it is seen as the value of the first element in the array.

True

CH7- When defining a parameter variable to hold a single- dimensional array argument, you do not have to include the size declarator.

False

CH7- You can use the [ ] operator to inset a value into a vector that has no elements.

portability

CH1- A program's ability to run on several different types of computer systems is called _______.

variable

CH1- A(n) __________ is a named storage location.

Control Unit, Arithmetic and Logic Unit

CH1- Internally, the CPU consists of the ______ and the ____.

programming

CH1- Since computers can't be programmed in natural human language, the algorithms that run them must be written by humans in a(n) __________ language.

CPU

CH1- The job _________ is to fetch instructions, carry out the operations commanded by the instructions, and produce some outcome or resultant information.

Programmer defined identifiers

CH1- Words or names defined by the programmer are called _________.

output

CH1- _______ is information a program sends to the outside world.

high level

CH1- __________ languages are close to the level of humans in terms of readability.

Braces { }

CH2- A group of statements, such as the contents of a function, is enclosed in ______.

True

CH2- A variable must be defined before it can be used.

named constant

CH2- A(n) ______ is like a variable, but its value is read-only and cannot be changed during the program's execution.

Function main

CH2- Every C++ program must have a _______.

Semicolon

CH2- Every complete statement ends with a _________.

Before the compiler compiles your program

CH2- When do preprocessor directives execute?

False

CH2- You cannot initialize a named constant that is declared with the const modifier.

log10( )

CH3- The ___ library function returns the base- 10 logarithm of a number.

log( )

CH3- The ____ library function returns the natural logarithm of a number.

fmod( )

CH3- The ____ library function returns the remainder of a floating point division.

tan( )

CH3- The ____ library function returns the tangent of an angle.

pow( )

CH3- The ____ library function returns the value of a number raised to a power.

exp( )

CH3- The _____ library function returns the exponential function of a number.

sqrt( )

CH3- The _____ library function returns the square root of a number.

<cmath>

CH3- The ______ file must be included in a program that uses the mathematical functions.

sin( )

CH3- The _______ library function returns the sine of an angle.

cos( )

CH3- The ________ library function returns to the cosine of an angle.

True

CH4- A conditionally executed statement should be indented one statement.

true, false

CH4- A relational expression is either ____ or ___ .

block

CH4- A variable with _____ scope is only visible when the program is executing in the block containing the variable's definition.

True

CH4- Assume the variables x = 5, y = 6, and z = 8. Indicate by circling the T or F whether each of the following conditions is true or false: 2 !=y && z !=4

True

CH4- Assume the variables x = 5, y = 6, and z = 8. Indicate by circling the T or F whether each of the following conditions is true or false: x==5 || y>3

Braces

CH4- For an if statement to conditionally execute a group of statements, the statement must be enclosed in a set of ______.

&&

CH4- If the sub- expression on the left of the _____ logical operator is false, the right sub- expression is not checked.

False

CH4- It's safe to assume that all uninitialized variables automatically start with 0 as their value.

False

CH4- The = operator and the == operatorperform the same operation when used in a Boolean expression.

!

CH4- The ____ logical operator has higher precedence than the other logical operators.

&&

CH4- The ____ logical operator works best when testing a number to determine if it is within a range.

integer constant

CH4- The expression following a case statement must be a(n) __________.

True

CH4- The scope of a variable is limited to the block in which it is defined.

default

CH4- The trailing else in an if/else if statement has a similar purpose as the ______ section of a switch statement.

posttest

CH5- A loop that evaluates its text expression after each repetition is a(n) __________ loop.

nested

CH5- A loop that is inside another is called a(n) ______ loop.

iteration

CH5- Each repetition of a loop is known as a(n) __________.

False

CH5- In a nested loop, the outer loop executes faster than the inner loop.

for

CH5- The _____ loop is ideal for situation that require a counter.

do-while

CH5- The ______ loops always iterates at least once.

True

CH5- The cout statement in the following program segment will display 5: int x=5; cout << x++;

False

CH5- The for loop is a posttest loop.

True

CH5- The while loop is a pretest loop.

increment, decrement

CH5- To _______ a value means to increase it by one, and to ______ a value means to decrease it by one.

True

CH5- Variables may be defined inside the body of a loop.

postfix

CH5- When the increment or decrement operator is placed after the operand (or to the operand's right), the operator is being used in _______.

True

CH5- When you call an ofstream object's open member function, the specified file will be erased if it already exists.

prototype

CH6- A(n) _______ eliminates the need to place a function definition before all calls to the function.

& (ampersand)

CH6- Reference variables are defined like regular variables, except there is a(n) _______ in front of the name.

parameters

CH6- Special variables that hold copies of function arguments are called ______.

header

CH6- The ____ is the part of a function definition that shows the function name, return type, and parameter list.

exit

CH6- The ________ function causes a program to terminate.

False

CH6- The exit function can only be called from main.

True

CH6- The scope of a parameter is limited to the function which uses it.

constant

CH6- The value of a defailt argument must be a(n) _________.

zero

CH6- Unless you explicitly initialize global variables, they are automatically initialized to_______.

False

CH6- When a function terminates, it always branches back to main, regardless of where it was called from.

True

CH6- When a function with default arguments is called and an argument is left out, all arguments that come after it must be left out as well.

default

CH6- _______ arguments are passed to parameters automatically if no argument is provided in the funciton call.

static

CH6- ________ local variables retain their value between function calls.

global

CH6- ________ variables are defined outside all functions and are accessible to any function within their scope.

definition, prototype

CH6-Either a function's _______ or its ______ must precede all calls to the function.

False

CH7- An array's size declarator can be either a literal, a named constant, or a variable.

address

CH7- Any time the name of an array is used without brackets and a subscript, it is seen as ___________.

False

CH7- Arrays cannot be initialized when they are defined. A loop or other means must be used.

True

CH7- C++ allows you to create arrays with three or more dimensions.

True

CH7- C++ allows you to partially initialize an array.

bounds

CH7- C++ has no array ______ checking, which means you can inadvertently store data past the end of an array.

Zero

CH7- If an array is partially initialized, the uninitialized elements will be set to _____.

False

CH7- If you leave an element uninitialized, you do not have to leave all the ones that follow it uninitialized.

True

CH7- Subscript number may be stored in variables.

Zero

CH7- Subscript numbering in C++ always starts at ____.

False

CH7- The first size declarator (in the declaration of a two- dimensional array) represents the number of columns. The second size definition represents the number of rows.

True

CH7- The individual elements of an array are accessed and indexed by unique numbers.

Integer, 0

CH7- The size declarator must be a(n) ______ with a value greater than _____.

True

CH7- The subscript of the last element in a single- dimensional array is one less than the total number of elements in the array.

False

CH7- The uninitialized elements of a string array will automatically be set to the value "0".

clear

CH7- To completely clear the contents of a vector, use the ______ member function.

two

CH7- To define a two- dimensional array, _________ size declarators are required.

vector

CH7- To define a vector in your program, you must #include the _______ header file.

size

CH7- To determine the number of elements in a vector, use the _______ member function.

Programmed

CH1- Computers can do many different jobs because they can be ______.

#

CH2- Preprocessor directives begin with a ________.


Kaugnay na mga set ng pag-aaral

A separate peace chapter 5-10 discussion quiz

View Set

Basiswissen Geschichte 15 (Erster Weltkrieg)

View Set

Social Science - Chapter 2, 3, and 10

View Set

AP Government Midterm study guide

View Set

Financial statement analysis and ratios

View Set