Structural Programming Week 3, Structured Programming(Week 4), Structured chapter 11, Structured week 13, Structured week 12, Structured Chapter 9 and 10, Chapter 8, Structural Programming Week 5&6, Structured chapter 7

¡Supera tus tareas y exámenes ahora con Quizwiz!

A problem can be solved with recursion if it can be broken down into successive smaller problems that are identical to the overall problem.

True, False

A function ______ eliminates the need to place a function definition before all calls to the function.

prototype

A function _______ eliminates the need to place a function definition before all calls to the function.

prototype

A function _________ eliminates the need to place a function definition before all calls to the function.

prototype

The ______ member function accepts a value as an argument and stores that value after the last element in the vector.

push_back()

The ______ is a loop that iterates once for each element in a container. Each time the loop iterates, it copies an element from the container to a variable.

range-based for loop

When a piece of data is ___ from a file, it is copied from the file into a variable in RAM.

read

A file's ___ marks the location of the next byte that will be read from the file.

read position

A _____ function is one that calls itself.

recursive

When used as parameters, _____ variables allow a function to access the parameter's original argument. Changes to the parameter are also made to the argument.

reference

When used as parameters, _______ variables allow a function to access the parameter's original argument. Changes to the parameter are also made to the argument.

reference

___ allow programmers to compare values.

relational operators

The _______ member function increases the number of values that a vector may store by the number indicated by its first argument.

resize()

A function can send a value to the part of the program that executed it. This value is called a(n) ______ value.

return

A function can send a value to the part of the program that executed it. This value is called a(n) _______ value.

return

A(n) ___ is a summation that is continually adjusted to take account of items as they are "seen" by a program.

running total

A(n) ______ is a summation that is continually adjusted to take account of items as they are "seen" by a program.

running total

The ____ sort works like this: The smallest value in the array is located and moved to element 0. Then, the next smallest value is located and moved to element 1. This process continues until all of the elements have been placed in their proper order.

selection

The programming construct that allows the computer to decide which of two or more paths to follow is known as ___.

selection

A(n) ___ is a special value that cannot be mistaken as a member of data and signals that there are no more data values to be entered.

sentinel

A(n) ___ is used to indicate the end of data.

sentinel

A(n) ______ is used to indicate the end of data.

sentinel

A(n)______ is a special value that cannot be mistaken as a member of data and signals that there are no more data values to be entered.

sentinel

When you work with a(n) ___ access file, you access data from the beginning of the file to the end of the file.

sequential

If the sub-expression on the left side of an && operator is false, the expression on the right side will not be checked. Since the entire expression is false if only one of the sub-expressions is false, it would waste CPU time to check the remaining expression. This is called ___.

short-circuit evaluation

A(n)_____ indicates how many values an array can store.

size declarator

Unlike arrays, vectors can report the number of elements they contain using the _____ member function.

size()

Variables that are defined inside a function that remain in memory after the function has finished executing are called ______ variables.

static

_______ local variables exist for the lifetime of the program, even though their scope is only the function in which they are defined.

static

________ local variables exist for the lifetime of the program, even though their scope is only the function in which they are defined.

static

C++ allows you to group several variables together into a single item known as a ____.

structure

A(n) _______ is a dummy function that is called instead of the actual function it represents. It usually displays a test message acknowledging that it was called, and nothing more.

stub

A(n)_____ is a dummy finction that is called instead of the actual function it represents. It usually displays a test message acknowledging that it was called, and nothing more.

stub

A(n) ________ or index, is used to pinpoint a specific location within an array.

subscript

Data in a standard C++ array is accessible only via the _____.

subscript operator

A(n) ___ is one of the basic elements of the syntactic structure of a program, analogous to a word in a natural language.

token

The term ___ means the programmer starts reading the program, or a portion of the program, and steps through each statement, perhaps noting current variable contents and displayed data on a sheet of paper.

tracing

A(n) ___ expression lets you manually change from one data type to another. This change is not reflected in how a variable is stored in memory.

type cast

When C++ is working with an operator, it strives to convert the operands to the same type. This automatic conversion is known as ___.

type coercion

When a variable is assigned a value that is too small in range for that variable's data type, the variable ___.

underflows

A common kind of reassignment is a(n) ___, where the new value of the variable depends on the old.

update

A common kind of reassignment is a(n) _______ where the new value of the variable depends on the old.

update

An assignment where the new value of the variable depends on the old is a(n) ___.

update

An assignment where the new value of the variable depends on the old is a(n) _____.

update

The third expression in a for loop header is the ____. It executes at the end of each iteration. Typically, this is a statement that increments the loop's counter variable.

update expression

The third expression in a for loop header is the _____. It executes at the end of each iteration. Typically, this is a statement that increments the loop's counter variable.

update expression

A(n) _______ holds a sequence of values stored in contiguous memory locations. The number of values to be stored does not have to be specified when declared and if data is added when the data structure is full, its size will be increased to accommodate the new value automatically.

vector

A(n) ______ function is a function that does not return a value to the part of the program that executed it.

void

A(n) ________ function is a function that does not return a value to the part of the program that executed it.

void

___ refers to all characters that appear as blanks on a display screen or printer.

whitespace

When a piece of data is ___ to a file, it is copied from a variable in RAM to the file.

written

To determine the number of values that may currently be stored in a vector, use the _________ member function.

сараcity()

In computer programming. _____ code is part of the source code of a program which can never be executed because there exists no control flow path to the code from the rest of the program.

dead, unreachable

In the computer programming, ________ code is part of the source code of a program which can never be executed because there exists no control flow path to the code from the rest of program.

dead, unreachable

A(n) ___ executes some statements only under certain circumstances.

decision structure

______ arguments are passed to parameters automatically if no argument is provided in the function call.

default

_________ arguments are passed to parameters automatically if no argument is provided in the function call.

default

A function ______ contains the interface to the function as well as the statements that make up the function.

definition

A function ________ contains the interface to the function as well as the statements that make up the function.

definition

If a container is sorted in ______ order, it means the values in the container are stored from highest to lowest.

descending

_______ recursion is when a recursive function calls itself.

direct

A(n) [a], or [b], is defined as an organizational unit, or container, used to organize files into a hierarchical structure.

directory or folder

The _____ operator allows you to access structure members in a program.

dot

_____ is code that tests a function by simply calling it.

driver code

______ involves writing and testing small portions of a program repeatedly until the program is complete.

incremental development

_______ involves writing and testing small portions of a program repeatedly until the program is complete.

incremental development

_______ recursion occurs when function A calls function B, which in turn calls function A. There can even be several functions involved in the recursion. For example, function A could call function B. which could call function C, which calls function A.

indirect

A repeating sequence of instructions that has no way to stop repeating would be a(n) ___.

infinite loop

A repeating sequence of instructions that has no way to stop repeating would be a(n) ______.

infinite loop

A(n) ___ is a loop in which the terminating condition is never satisfied.

infinite loop

A(n) ___ is a sequence of instructions in a computer program which loops endlessly.

infinite loop

A(n) ______ is a loop in which the terminating condition is never satisfied.

infinite loop

A(n) ______ is a sequence of instructions in a computer program which loops endlessly.

infinite loop

A(n) ____ is the first expression in a for loop header. It is normally used to initialize a counter variable to its starting value. This is the first action performed by the loop, and it is only done once.

initialization expression

A(n) _________ is the first expression in a for loop header. It is normaly used to initialire a counter variable to its starting value. This is the first action performed by the loop, and only done once.

initialization expression

To ___ a variable is to store a value in the variable for the first time.

initialize

To ____ a variable is to store a value in the variable for the first time.

initialize

________ is the process of inspecting data given to a program by the user and determining if it is valid.

input validation

A single pass through a loop is known as a(n) ___.

iteration

A single pass through a loop is known as a(n) _____.

iteration

___ is repeated execution of a set of statements.

iteration, repetition, looping

______ is repeated execution of a set of statements.

iteration, repetition, looping

A(n) _______ is an STL object that behaves like a pointer (a variable that "points" to some piece of data that is stored in the computer's memory). It is used to access the individual data elements in a container.

iterator

When the user types values at the keyboard, those values are first stored in an area of memory known as the ___.

keyboard buffer

When a variable ___, it may no longer be used.

leaves scope

A(n) ______ is a package of code that is meant to be reused by many programs.

library

A(n) _______ is a collection of precompiled routines that a program can use.

library

A(n) ________ is a package of code that is meant to be reused by many programs.

library

A(n) is a package of code that is meant to be reused by many programs.

library

When a copy of an argument is passed to a function, it is said to be _____.

pass by value

When a reference variable is used as a parameter, it is said that the argument is _____.

passed by reference

When a reference variable is used as a parameter, it is said that the argument is ______.

passed by reference

When a copy of an argument is passed to a function, it is said to be _____.

passed by value

Text that is not computationally tagged or specially formatted is referred to as ___.

plain text

Use the _____ member function to remove the last element from a vector.

pop_back()

In ____, the increment or decrement operator is placed after the variable.

postfix mode

In a ____ loop, the loop's expression is tested after each iteration.

posttest

In a ______ loop, the loop's expression is tested after each iteration.

posttest

Significant digits, or ___, is the total number of digits that appear before and after the decimal point.

precision

In ____, the increment or decrement operator is placed before the variable.

prefix mode

In _______ the increment or decrement operator is placed before the variable.

prefix mode

In a ____ loop, the loop's expression is tested prior to an iteration.

pretest

In a _____ loop, the loop's expression is tested prior to an iteration.

pretest

The read operation that takes place just before an input validation loop is called a ____. It provides the first value for the loop to test.

priming read

The read operation that takes place just before an input validation loop is called a _____ It provides the first value for the loop to test.

priming read

C++ has several ______ data types, or data types that are defined as a basic part of the language, such as int, double and bool.

primitive

A file on a disk is identified by a(n) [a] while the file's location is specified using a(n) [b] which may be [c]to a known location or, if specified beginning with the drive letter, may be [d].

(A)filename (b)a path (C) absolute.

When a value is converted to a higher data type, it is said to be [a]; to [b] a value means to convert it to a lower data type.

(A)promoted; (B)to demote

Variables defined inside a set of braces have [a] scope or [b] scope.

A) block B) local

A(n) [a] expression (a.k.a. [b] expression or [c] expression) has a value that is either true or false.

A)Boolean B) conditional C) Relational

_________ data types (ADTS) are data types created by the programmer. ADTS have their own range (or domain) of data and their own sets of operations that may be performed on them.

Abstract

The very first line of a function definition is the function ______.

header

The very first line of a function definition is the function ________.

header

[a] refers to transferring information from a file to a program while [b] refers to transferring information from a program to a file.

(A)File input refers to transferring information from a file to a program (b)while file output refers to transferring information from a program to a file.

x > y is an example of a(n) ___ expression.

Boolean or relational or conditional

________ arguments are passed to parameters automatically if no argument is provided in the function call.

Correct default

___ is similar to scientific notation in that it defines a floating-point value as a mantissa and a power of ten; in this form, the number 47,281.97 would be written as 4.728197E4.

E notation

____ is the process of inspecting data given to a program by the user and determining if it is valid.

Input validation

In ______ the increment or decrement operator is placed after the variable.

Postfix mode

A(n) _______ will receive the value of a different container element during each iteration of a range-based for loop. During the first loop iteration, it receives the value of the first element; during the second iteration, it receives the value of the second element, and so forth.

Range variable

The _______ is a collection of data types and algorithms that you may use in your programs. These data types and algorithms are programmer-defined. They are not part of the C++ language, but were created in addition to the built-in data types.

Standard Template Library

Any problem that can be solved recursively can also be solved iteratively, with a loop. In fact, recursive algorithms are usually less efficient than iterative algorithms. This is because a function call requires several actions to be performed by the C++ runtime system. These actions include allocating memory for parameters and local variables and storing the address of the program location where control returns after the function terminates. These actions, which are sometimes referred to as overhead, take place with each function callI. Such overhead is not necessary with a loop.

True, False

A(n) _______ is a special variable that holds a value being passed into a function.

parameter

In programming, a function is a named section of a program that performs a specific task. In this sense, a function is a type of [a] or [b]. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs some operation but does not return a value.

a) Procedure b) Subroutine

______ is repeated execution of a set of statements; one execution of the set of statements is referred to as a(n) ______.

a) Repetition b) iteration

Values that are sent to a function are called [a] (a.k.a. (b).

a) arguments b) actual parameters

Values that are sent to a function are called [a] (a.k.a. [b]).

a) arguments b) actual parameters

Values that are sent to a function are called [a] (a.k.a. [b]).

a) arguments b)actual parameters

To (a] is to decrease the value of a variable, usually by the value of one, while to [b] is to increase the value of a variable, usually by the value of one.

a) decrement b) increment

To ______ is to decrease the value of a variable, usually by the value of one, while to ____ is to increase the value of a variable, usually by the value of one.

a) decrement decreases b) increment increases

In programming, a function is a named section of a program that performs a specific task. In this sense, a function is a type of [a] or [b] Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs some operation but does not retum a value.

a) procedure b) subroutine

A(n) ______ is a summation that is continually adjusted to take account of items as they are "seen" by a program; these summations are stored in a variable referred to as a(n) _____.

a) running total b) accumulator

A(n) [a] is a summation that is continually adiusted to take account of items as they are "seen" by a program; these summations are stored in a variable referred to as a(n) (b).

a) running total b) accumulator

The number inside the brackets of an array definition is the (a), but the number inside an array's brackets in an assignment statement, or any other statement that works with the contents of the array, is the [b).

a) size declarator b) subscript

Data in a vector may be directly retrieved using an index by implementing the (a] (dangerous and should be avoided) or the [b] member function.

a) subscript b) at()

Data can be stored in a vector via the [a] or the [b] member function.

a) subscript operator b) push_back()

A(n) [a] and a(n) [b) each work like a variable that can store a group of values.

a)array b)vector

In programming, a function is a named section of a program that performs a specific task. In this sense, a function is a type of [a] or [b]. Some programming languages make a distinction betweer a function, which returns a value, and a procedure, which performs some operation but does not return a value.

a)procedure b)subroutine

[a] is repeated execution of a set of statements; one execution of the set of statements is referred to as a(n) [b].

a)repetition b)iteration

An ______ is a general model of something. It is a definition that includes only the general characteristics of an object.

abstraction

The _______ provided by the STL are implemented as function templates (a generic function that can work with a variety data types) and perform various operations on elements of containers.

algorithms

A(n) _______ allows you to store and work with multiple values of the same data type. The number of values to be stored must be specified at declaration.

array

While sorting the data in ______ order, arrange the data in a way such that each element is in some way "smaller than" its sucessor.

ascending

To retrieve the value of an element in a vector, use the _____ member function.

at()

The______ is the part of a calculation that can be solved without recursion. This stops the recursive function from continuing to call itself.

base case

In computer programming, _______ code is part of the source code of a program which can never be executed because there exists no control flow path to the code from the rest of the program.

dead, unreachable

The _______ search is a clever algorithm that is much more efficient than the sequential search. Its only requirement is that the values in the container be sorted in order. Instead of testing the container's first element, this algorithm starts with the element in the middle. If that element happens to contain the desired value, then the search is over. Otherwise, the value in the middle element is either greater than or less than the value being searched for. If it is greater, then the desired value (if it is in the list) will be found somewhere in the first half of the container. If it is less, then the desired value (again, if it is in the list) will be found somewhere in the last half of the container. In either case, half of the container's elements have been eliminated from further searching.

binary

The - of a function is the set of statements that perform the function's operation.

body

The _______ of a function is the set of statements that perform the function's operation.

body

___ values are either true or false.

boolean

C++ does not perform array ______. This means you can write programs with subscripts that go beyond the boundaries of a particular array.

bounds checking

Each alternative set of code in a selection control structure is referred to as a(n) ___.

branch

The following algorithm for the _____ sort:

bubble

A function ___ is a statement that causes a function to execute.

call

A function ______ is a statement that causes a function to execute.

call

A function _________ is a statement that causes a function to execute.

call

Sometimes, when determining which set of statements to execute, there are more than two possibilities. In such a case, a(n) ___ may be employed.

chained conditional

To completely delete the contents of a vector, use the ____ member function.

clear()

Enclosing a group of statements inside a set of braces creates a(n) _____.

code block

Enclosing a group of statements inside a set of braces creates a(n) _______.

code block

Enclosing a group of statements inside a set of braces creates a(n) ________.

code block

When a program is running and it enters the section of code that constitutes a variable's scope, it is said that the variable ___.

comes into scope

A(n) ___ is the Boolean expression in a selection control structure that determines which set of code is executed.

condition

___ is when a statement or code block is executed dependent upon the result of a Boolean expression

conditional execution

The data types that are defined in the STL are commonly called ____ because they store and organize data.

containers

A(n) ___ results in a choice being made (a) as to which of two or more paths to follow or (b) whether to follow the same path again.

control structure

With a(n) ___ loop, the number of repetitions is known before the loop begins executing.

count controlled

With a(n) _______ loop, the number of repetitions is known before the loop begins executing.

count-controlled

A ____ is a variable that is regularly incremented or decremented each time a loop iterates.

counter

A _____ is a variable that is regularly incremented or decremented each time a loop iterates.

counter

Each storage location of an aray or vector is referred to as a(n) ____.

element

The ______ member function returns true if no data is stored in the vector and false if data is stored in the vector

empty()

An enumerated data type is a programmer-defined data type. It consists of values known as _______, which represent integer constants.

enumerators

The way a computer stores floating-point numbers can allow an error in precision. Comparing two floating-point numbers for equality should take this into account. One way to compare two floating-point numbers for equality is to use ___ which involves checking that the difference between the two numbers is small enough to be ignored.

epsilon comparison

With a(n) ___ loop, the number of repetitions is unknown before the loop begins executing.

event-controlled

With a(n) ____ loop, the number of repetitions is unknown before the loop begins executing.

event-controlled

The ___ is the minimum number of character positions, or spaces, on the screen in which to print a value.

field width

A(n) ___ is a collection of data that is usually stored on a computer's disk.

file

A(n) ___ is an identifier that forms a bridge between a program and a file on the hard drive.

file handle

___ is the same as standard decimal notation which represents floating-point numbers with a decimal point between the whole part of the number and the fractional part of the number.

fixed-point notation

A(n) ___ is a Boolean variable that signals when a condition exists.

flag

A(n) ___ is raised when the program detects that an event has occurred.

flag

A(n) ______ is raised when the program detects that an event has occurred.

flag

The order in which statements are executed in a program is referred to as the program's ____.

flow of execution

The order in which statements are executed in a program is referred to as the program's _____.

flow of execution

The order in which statements are executed in a program is referred to as the program's ______.

flow of execution

The list of parameters indicated in the function definition are called _____ parameters.

formal

The list of parameters indicated in the function definition are called ______ parameters.

formal

The list of parameters indicated in the function definition are called _______ parameters.

formal

The way a value is printed is called its ___.

formatting

A(n) _______ is a collection of statements that performs a specific task.

function

A(n)_ is a collection of statements that performs a specific task.

function

A(n)_____ is a collection of statements that performs a specific task.

function

A(n) ____ is a programming construct that allows a programmer to associate a given set of instructions with a specific name.

function, subroutine, procedure

A(n) _______ is a programming construct that allows a programmer to associate a given set of instructions with a specific name.

function, subroutine, procedure

A(n) ________ is a programming construct that allows a programmer to associate a given set of instructions with a specific name.

function, subroutine, procedure

A(n) _____ constant is a named constant that is available to every function in a program.

global

A(n) _____ variable is defined outside all functions and is accessible to all functions in its scope.

global

A(n) ______ constant is a named constant that is available to every function in a program.

global

A(n) ______ variable is defined outside all functions and is accessible to all functions in its scope.

global

A(n) _______ variable is defined outside all functions and is accessible to all functions in its scope.

global

A(n) ________ constant is a named constant that is available to every function in a program.

global

The ______ search, also known as the sequential search, uses a loop to sequentially step through a container, starting with the first element. It compares each element with the value being searched for, and stops when either the value is found or the end of the container is encountered. If the value being searched for is not in the container, the algorithm will unsuccessfully search to the end of the container.

linear

A(n) ______ variable is defined inside a function and is not accessible outside the function.

local

A(n) ________ variable is defined inside a function and is not accessible outside the function.

local

Variables that are defined inside a function are called ______ variables.

local

Variables that are defined inside a function are called _______ variables.

local

___ connect two or more relational expressions into one expression or reverse the logic of an expression.

logical operators

A ____ is a control structure that causes a statement or group of statements to repeat.

loop

A ____ is part of a program that repeats.

loop

A ______ is a control structure that causes a statement or group of statements to repeat

loop

A ______ is part of a program that repeats.

loop

The statement or block of statements that repeat is known as the ____.

loop body

The statement or block of statements that repeat is known as the _______.

loop body

The first line of a while or for loop is the ____.

loop header

The first line of a while or for loop is the ______.

loop header

A(n) ___ of a class or object is a function that has its definition within the class definition like any other variable. It operates on any object of the class of which it is a member, and has access to all the members of a class for that object.

member function

The variables declared within the curly braces of a structure definition are known as _______ of the structure.

members

Instead of writing one long program that contains all of the statements necessary to solve a problem, several small functions that each solve a specific part of the problem can be written. A program of this type called a(n) _______ program.

modular

Instead of writing one long program that contains all of the statements necessary to solve a problem, several small functions that each solve a specific part of the problem can be written. A program of this type is called a(n) ______ program.

modular

Instead of writing one long program that contains all of the statements necessary to solve a problem, several small functions that each solve a specific part of the problem can be written. A program of this type is called a(n) ________ program.

modular

___ describes how a variable in a loop stores different values throughout the execution of the loop.

multiple assignment

_______ describes how a variable in a loop stores different values throughout the execution of the loop.

multiple assignment

A conditional control structure inside another conditional control structure is a(n) ___ conditional.

nested

A loop that is inside another loop is called a ____.

nested loop

The ___ is an empty statement that does nothing

null statement

One specific error, demonstrated in the code below, regarding array bounds is known as the ______.

off-by-one error

A(n) ___ is the location in memory where data that is ready to be seen is stored until the memory area is full or it is flushed, at which time the output is sent to the output device.

output buffer

When a variable is assigned a value that is too large in range for that variable's data type, the variable ___.

overflows

Function ____ is a programming concept that allows programmers to define two or more functions with the same name as long as each of the functions has a unique signature.

overloading

Function ______ is a programming concept that allows programmers to define two or more functions with the same name as long as each of the functions has a unique signature

overloading

Function_is a programming concept that allows programmers to define two or more functions with the same name as long as each of the functions has a unique signature,

overloading

A(n) ______ is a special variable that holds a value being passed into a function.

parameter


Conjuntos de estudio relacionados

Oregon Permit Test - Missed Questions

View Set

Ch 13 lab Map, Ch 12 lab map, CH 11 Lab MAP, Ch 10 lab map, Ch 13 Powerpoint, Chapter 12 Power Point, Ch 11 PowerPoint, PowerPoint 10, CH 8 & 9 PPQ A&P Lab, Midterm lab A&P "Review", Midterm Lab Review A&P, Ch 5-7 Lab A&P Mastering, Ch 5-7 PP Quizzes...

View Set

Chapter 9 The flow of food: service

View Set

Chapter 29: Vertebrate evolution and diversity

View Set

Chapter 24 Diuretic Therapy and Drugs for Renal Failure

View Set

Chapter 27: Disorders of the bladder and lower urinary tract

View Set