







































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Structured Programming Final Questions And A+ Answers
Typology: Exams
1 / 47
This page cannot be seen from the preview
Don't miss anything!








































Why does the index of an array, or vector, always start at 0? - correct answer used as an off set adds data to a stream - correct answer << Are used to enclose file name with include directive - correct answer <> Are used to enclose a group of statements creating a code block - correct answer {} are used to enclose character literals - correct answer ' are used to enclose string literals - correct answer " denotes a Doxygen comment - correct answer /** is used to indicate the end of a string in memory. - correct answer
marks the end of a complete programming statement. - correct answer ;
removes data from a stream - correct answer >> represents a newline which causes the cursor to move to the next line - correct answer \n A line that starts with a(n) ____ is called a preprocessor directive - correct answer # The ____ marks the beginning and ____ marks the end of a multi-line comment - correct answer /* */ The ____ marks the beginning of a single-line comment - correct answer // ____ and ____ are required in a function call, even if there is no data to send to the function - correct answer () copies the value on the right into the storage location in memory associated with the variable on the left - correct answer =
A(n) ___ variable is defined outside all functions and is accessible to all functions in its scope. - correct answer global A(n) ___ is a summation that is continually adjusted to take account of items as they are "seen" by a program. - correct answer running total ___ refers to the rules that define which operators to evaluate first to simplify expressions. - correct answer precedence ___ recursion is when a recursive function calls itself. - correct answer direct A(n) ___ variable is defined inside a function and is not accessible outside the function. Variables that are defined inside a function are called ___ variables. Variables defined inside a set of braces have [a] scope or [b] scope. - correct answer local
A problem can be solved with recursion if it can be broken down into successive smaller problems that are identical to the overall problem. - correct answer True/false If a container is sorted in ___ order, it means the values in the container are stored from highest to lowest. - correct answer descending Displaying information to the user via the screen is called ___. - correct answer console output A(n) ___ is a programming construct that allows programmers to group a sequence of statements together. Enclosing a group of statements inside a set of braces creates a(n) ___. - correct answer code block A(n) ___ is a special language used to write computer programs. - correct answer programming language
patterns the interpreter/compiler attempt to match during this process make up the [c] of the programming language. - correct answer a = parsing b = tokens c = syntax In a ____ loop, the loop's expression is tested after each iteration. - correct answer posttest loop A(n) ___ operates on a single operand. - correct answer unary operator 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. - correct answer member function A(n) ___ is a set of well-defined, sequentially ordered, unambiguous steps for performing a task or solving a problem. - correct answer algorithm ___ 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. - correct answer fixed-point notation A(n) ___ contains machine language instructions and is ready to run on the computer. - correct answer executable file An expression that cannot be evaluated any further is referred to as a(n) ___. - correct answer value A(n) ___ is a string that will appear on the screen; it should inform the user of the desired data needed. - correct answer prompt In computer science, ___ is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. - correct answer flow of execution A variable's ___ is the part of the program that has access to the variable. - correct answer scope
visually arrange a program's code. - correct answer programming style A ____ is a control structure that causes a statement or group of statements to repeat. - correct answer A loop is a control structure that causes a statement or group of statements to repeat. ___ arguments are passed to parameters automatically if no argument is provided in the function call. - correct answer default ___ is based on the principle of building some before building all; it is a process whereby one small part of a program is written and tested before another small part of the program is written and tested, etc. until the product is finished. - correct answer incremental development A(n) ___ indicates how many values an array can store. - correct answer size declarator single pass through a loop is known as an - correct answer iteration
The ___ of a computer language is the set of rules that defines the combinations of symbols that are considered to be a correctly structured document in that language. - correct answer syntax 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 ___. - correct answer short-circuit evaluation the data that operators work with - correct answer operands The term ___ is used to describe any modular collection of statements that either returns a result directly or is called for some side-effect it produces. - correct answer function An enumerated data type is a programmer-defined data type. It consists of values known as ___, which represent integer constants. - correct answer enumerators
___ determines how operators of the same precedence are evaluated in absence of parentheses. - correct answer associativity Running existing code to verify it works correctly is known as ___. - correct answer testing Data should be stored in a vector via the [a], [b] or [c] member functions. - correct answer a = at() b = insert() c = push_back() [a] refers to transferring information from a file to a program while [b] refers to transferring information from a program to a file. - correct answer a = file input b = file output A(n) ___ is a word in a programming language that has a predefined meaning which cannot be changed. - correct answer keyword
A(n) ___ is a variable, a value or a combination of variables, operators, and values that results a single value. - correct answer expression Variables defined inside a set of braces have [a] scope or [b] scope. - correct answer block, local A(n) [a] is a piece of data that is written directly into program code; the process of writing data directly into program code is known as [b]. - correct answer a = literal b = hard-coding A(n) ___ is a Boolean variable that signals when a condition exists. - correct answer flag An expression is simplified by performing the specified operations in order to yield a single value. This process is referred to as ___ an expression. - correct answer evaluating Data in a standard C++ array is accessible only via the ___. - correct answer subscript operator
Problems that do not occur until a program is executing are ___. - correct answer runtime errors 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. - correct answer algorithms When a variable ___, it may no longer be used. - correct answer leaves scope An explanation of code, intended only for other programmers, may be added to a program as a(n) ___. - correct answer comment Program code that fails to follow the rules of the language produce ___. - correct answer syntax errors ___ is a characteristic attributed to a computer program if it can be used in an operating systems other than the one in which it was created without requiring major rework. - correct answer portability
An error, flaw, failure, or fault in a computer program is referred to as a(n) ___. - correct answer bug A(n) ___ statement instructs the computer to store the operand on the right of the operator in the memory location specified by the operand on the left of the operator. - correct answer assignment A named value, or ___, is like a variable, but its content is read-only and cannot be changed while the program is running. - correct answer constant 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. - correct answer output buffer ___ is information a program gathers from the outside world. - correct answer input When a piece of data is ___ to a file, it is copied from a variable in RAM to the file. - correct answer written
The way a value is printed is called its ___. - correct answer formatting 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.
When you work with a(n) ___ access file, you access data from the beginning of the file to the end of the file. - correct answer sequential A function can send a value to the part of the program that executed it. This value is called a(n) ___ value. - correct answer return A(n) [a], or [b], is defined as an organizational unit, or container, used to organize files into a hierarchical structure. - correct answer directory or folder ___ is a classification of the information that is stored in a variable. - correct answer data type With a(n) ___ loop, the number of repetitions is unknown before the loop begins executing. - correct answer event controlled One specific error, demonstrated in the code below, regarding array bounds is known as the ___.const int SIZE = 3;int values[SIZE];for (int i = 0; i <= SIZE; ++i) values[i] = 100; - correct answer off by one error