CISP 300 Final

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

False

A module can have two variables of the same name because they are within the same scope.

True

A nested decision structure can be used to test more than one condition.

an accompanying integer variable that holds the number of items that are actually stored in the array

A partially filled array is normally used with ________.

Reference

A pass by ________ argument means that the argument is passed into a parameter that will reference the content of the argument in the module.

False

A pass by reference argument establishes a two-way communication with the module, but the value of the argument cannot be modified via the reference variable.

syntax

A program cannot be translated if it has ________ errors.

nested

A structure that has a loop that is inside another loop is called a(n) ________ loop

Pages

A three-dimensional array can be thought of as ________ of two-dimensional arrays.

two-dimensional

A(n) ________ array is like several identical arrays put together.

global

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

Boolean

A(n) ________ expression evaluates as either true or false.

Named constant

A(n) ________ is a name that represents a value that cannot be changed during the program's execution.

compiler

A(n) ________ is a program that translates a high-level language program into a separate machine language program.

algorithm

A(n) ________ is a set of well-defined logical steps that must be taken to perform a task.

high-level

A(n) ________ language allows the programmer to create very powerful and complex programs without knowing how the CPU works.

infinite

A(n) ________ loop continues to repeat until the program is interrupted.

reference

A(n) ________ variable acts as an alias for the variable that was passed into the module through an argument.

local

A(n) ________ variable is declared inside a module and cannot be accessed by statements that are outside the module.

count

A(n) ________-controlled loop repeats a statement or set of statements a specific number of times.

None of these

Accepting February 29 in only a leap year is a check that is done by a ________ check.

Subscripts

Access the individual elements in an array by using their ________.

True

Although the sequence structure is heavily used in programming, it cannot handle every type of task.

False

An If statement will produce unpredictable results if the programmer does not use proper indentations in pseudocode.

True

An attempt to pass a non-variable argument into a reference variable parameter will cause an error.

outer

An inner loop goes through all of its iterations for every single iteration of the ________ loop.

argument

Any piece of data that is passed into a module when a module is executed is called an ________.

Bubble

As the ________ sorting algorithm makes passes through and compares the elements of the array, certain values move toward the end of the array with each pass.

False

Assembly language is referred to as a low-level language because it is close to the C++ language.

True

Checking for accuracy of data, even when the user provides the right type of data, is part of input validation.

False

Checking for reasonableness of data is programmatically impossible.

True

Complex mathematical expressions can sometimes be simplified by breaking out part of the expression and putting it in a function.

Defensive

Designing a program to avoid common errors is called ________ programming.

subscript

Every element in an array is assigned a unique number known as a ________.

A bit that is turned off is represented by the value -1.

False

Three

How many steps must be taken when a file is used by a program?

Two

How many subscripts do you need to access one element in a two-dimensional array?

Five

How many times will the following loop iterate? FOR count = 0 TO 4 DISPLAY count END FOR

Three

How many times will the following loop iterate? count = 2 DO DISPLAY count count= count + 1 UNTIL count == 5

One

How many times will the following loop iterate? count = 3 DO DISPLAY count count= count + 1 WHILE count == 5

Infinite

How many times will the following loop iterate? count = 80 WHILE count < 100 DISPLAY count END WHILE

NOT

If the expression is false, the ________ operator will return true.

False

If the user provides bad data as input to a program, the program will correct the data and produce output.

binary

In ________, all numeric values are written as a sequence of 1s and 0s.

None of these

In a binary search, what is the maximum number of comparisons that need to be performed if the array contains 1000 elements?

False

In a case-sensitive comparison, the string "yoda" and "YODA" are equivalent.

Rectangle

In a flowchart, the module call is represented by a ________ symbol with vertical bars at each side.

zero

In a selection sort, the minValue is set to element ________ in the first iteration of the outer loop.

minIndex

In a selection sort, which variable holds the subscript of the element with the smallest value found in the scanned area of the array?

False

In a sequential search algorithm, the Boolean variable used as a flag is initialized to TRUE.

Boolean Function

In addition to using loops to validate data, ________ can also be used to validate data.

True

In an expression with an OR operator, it does not matter which sub expression is true for the compound expression to be true.

Read position

In an input file, what maintains the location of the next item that will be read from the file?

Descending

In an insertion sort, what order are the elements in an array placed using the following Boolean expression? WHILE scan > 0 AND num[scan - 1] < unsorted

two

In general, how many types of files are there?

==

In languages such as Java, Python, C, and C++ the ________ operator determines whether a variable is equal to another variable.

True

In many languages it is an error to assign a real number to an integer variable

Switch

In many languages the case structure is called a ________ statement.

False

In most languages a module definition has three parts: a header, body, and footer.

True

In some languages you must use a library function to raise a number to a power.

processing

In the ________ step the data is either written to the file or read from the file.

array[index] and array[index+1]

In the bubble sort algorithm, the two arguments sent into the swap module are ________.

Integer

In the following declaration, what is the data type of the elements of the array? CONSTANT Integer SIZE = 20 DECLARE Integer num[SIZE]

Local

In the swap module, the third variable is declared as a ________ variable.

Validation

Input ________ is commonly done with a loop that iterates as long as an input variable contains bad data.

False

Input validation is not needed if the program is well designed.

True

Modules can be written for commonly needed tasks, and those modules can be incorporated into each program that needs them.

False

Modules make it impossible for programmers to work in teams.

False

Most programming languages do not provide library functions that can be used for input validation.

False

One of the advantages of two- or more dimensional arrays is that the data values can be of two or more data types.

Output

Opening a(n) ________ file creates a file on disk and allows the program to write data to it.

Value

Passing an argument by ________ means that only a copy of the argument's value is passed into the parameter variable.

Array

Processing a large number of items in a(n) ________ is usually easier than processing a large number of items stored in separate variables.

writing data to

Programmers usually refer to the process of saving data to a file as ________ a file.

True

Programs should be designed such that all input is inspected before it is processed and bad data is discarded.

False

Programs that use an interpreter generally execute faster than compiled programs because they are already entirely translated into machine language when executed.

For Each

Some programming languages provide this specialized loop that steps through an array, retrieving the value of each element.

True

The If-Then-Else-If statement can be used to simplify a complex nested decision structure.

ASCII

The ________ coding scheme contains a set of 128 numeric codes that are used to represent characters in a computer's memory.

Flowchart

The ________ is a diagram that graphically depicts the steps that take place in a program.

buffer

The ________ is a small holding section in memory.

unicode

The ________ is an extensive encoding scheme that is compatible with ASCII and can represent the characters of all the languages in the world.

CPU

The ________ is the most important component in a computer because without it, the computer could not run software.

AND

The ________ operator could be used, in some situations, to simplify nested selection structures.

NOT

The ________ operator is a unary operator, as it works with only one operand.

modulus

The ________ operator performs division and returns the remainder.

AND

The ________ operator requires both sub expressions to be true for the compound expression to be true.

debugging

The ________ process occurs when the programmer finds and corrects the code that is causing the error(s).

Diamond

The ________ symbol indicates that some condition must be tested in a flowchart.

parallelogram

The ________ symbol is used to represent the inputs and outputs in the steps of the program.

True

The arguments in a module call and the parameters listed in the module header must be of compatible data types.

False

The code of a library function must appear in a program in order for the program to call the library function.

random

The direct access file is also known as a(n) ________ access file.

Return

The ending terminal symbol for modules reads ________ because it marks the point where the computer returns to the part of the program that called the module.

False

The expressions (a + b) / c and a + b / c will always yield identical results.

Condition-controlled

The following is an example of what type of loop? WHILE count <=10 total = total + count count = count + 1 END WHILE

6

The following loop will perform ________ iterations. FOR counter = 10 TO 120 STEP 20 END FOR

True

The instruction set for a microprocessor is unique and is typically understood only by the microprocessors of the same brand.

Fetch-decode-execute

The process known as the ________ cycle is used by the CPU to execute instructions in a program.

opening

The process of ________ a file creates a connection between the file and the program.

Priming read

The purpose of the ________ is to get the first input value for the validation of a loop.

bit

The smallest storage location in a computer's memory is known as a ________.

source code

The statements that a programmer writes in a high-level language are called ________.

elements

The storage locations in an array are known as ________.

True

The structure of the camelCase naming convention is to write the first word of the variable name in lowercase letters and then to capitalize the first character of the second and subsequent words.

top-down design

The technique used by programmers to break down an algorithm into modules is called ________.

divide and conquer

The term ________ is used when a large task is divided into several smaller tasks that are easily performed.

iterations

The total number of ________ of a nested loop is the product of the number of iterations of all the loops.

15

The value of the expression 12 - 4 * 3 / 2 + 9 is ________.

accumulator

The variable that is used to keep the running total in a loop is called a(n) ________ in programming.

three

There are always ________ steps that must be taken when a file is used by a program.

IPO chart

This is a design tool that describes the input, processing, and output of a function.

library function

This is a prewritten function that is built into a programming languages.

substring

This is a string inside of another string

toReal

This is an example of a data type conversion function

body

This part of a function definition is comprised of one or more statements that are executed when the function is called.

header

This part of a function definition specifies the data type of the value that the function returns

send

This statement causes a function to end and sends a value back to the part of the program that called the function

black box

This term describes any mechanism that accepts input, performs some operation that cannot be seen on the input, and produces output.

type mismatch error

This type of error occurs when you try to assign a value of one data type to a variable of another data type

Boolean

This type of function returns either True or False

ascending

To order an array of strings in alphabetic order, the sorting algorithm should be structured for ________ order.

RAM is a volatile memory used for temporary storage while a program is running.

True

Rows and columns

Two-dimensional arrays can be thought of as containing ________.

Subscript of the midpoint

What does the variable middle represent in a binary search algorithm?

Translates and Execute

What function(s) does an interpreter perform with the instructions in a high-level programming language?

Filename extension

What is a short sequence of characters that appears at the end of a filename and is preceded by a period called?

Hand tracing

What is another term used for "desk checking"?

Twos complement

What is the encoding technique called that is used to store negative numbers in the computer's memory?

Garbage in, garbage out

What is the famous saying among computer programmers that refers to the fact that computers cannot tell the difference between good and bad data?

Design the program

What is the first step of the program development cycle?

Pseudocode

What is the informal language that programmers use to create models of programs that have no syntax rules and are not meant to be compiled or executed?

One

What is the subscript for the data value 92 in the example given below? DECLARE Integer values[4] = 100, 92, 105, 99

Return address

What is the term used for the memory address of the location of the statement immediately after the module call?

Size declarator

What is the term used for the number inside the bracket that specifies the number of values that an array can hold?

Input file

What is the term used to describe a file that data is read from?

Quotation

What symbol is used to mark the beginning and end of a string?

String literal

What term is used for a string that appears in the actual code of a program?

Hierarchy charts

What tool would a programmer use to visualize the relationship between modules?

Text file

What type of data file can be opened and viewed in an editor such as Notepad?

Binary file

What type of data file cannot be opened and viewed in an editor such as Notepad?

Output file

What type of file does the AppendMode work with?

String

What type of function can be used to see if the password entered has the minimum number of characters?

Condition-controlled

What type of loop uses a Boolean expression to control the number of times that it repeats a statement or set of statements?

Relational

What type of operator can be used to determine whether a specific relationship exists between two values?

Relational

What type of operators are the following? >, <=, ==, !=

cookie

When a web page is visited, the browser stores a small file on the user's computer, known as a ________.

sentinel

When processing a long list of values with a loop, the program knows it has reached the end of the list when the ________ value is read.

sequential search

When the ________ fails to locate an item, it must make a comparison with every element in the array.

Ascending

When the elements in an array are stored from lowest to highest, the array is sorted in ________ order.

True

When using string input validation it is wise to use the library function to convert the input to upper case or lowercase so case-sensitive string comparisons can be made.

Assembly

Which computer language uses short words known as mnemonics for writing programs?

logic

Which error produces incorrect results but does not prevent the program from running?

Rectangle

Which flowcharting symbol is used for opening and closing files?

Sequential

Which is the simplest search technique to use to find an item in an array?

Do-Until

Which loop repeats a statement or set of statements as long as the Boolean expression is false?

For

Which loop statement does not contain an increment statement but automatically increments the counter at the end of each iteration?

Which mathematical operator is used to raise five to the second power?

The array itself and an integer that specifies the number of elements in the array

Which of the following arguments must be passed when passing an array as an argument?

Declare Real retailPrice[SIZE]

Which of the following array declarations would be best suited for storing the retail prices?

All of these

Which of the following devices is a computer?

All of these

Which of the following is a logical operator?

All of these

Which of the following is a sorting algorithm?

All of these are checks for data accuracy

Which of the following is not a check for data accuracy?

Number

Which of the following is not a variable data type?

Microsoft Word

Which of the following is not an example of operating system software?

toUpper

Which of the following library functions could be used to simplify the process of string validation?

isReal

Which of the following library functions could be used to validate that the correct data type was input for an amount of money?

length

Which of the following library functions could be used to validate the length of a string?

Binary

Which of the following search algorithms should be used on large arrays if speed is important?

All of these

Which of the following software packages store data in files?

Bubble sort

Which of the following sorting algorithms is the least efficient?

This is an array declaration and initialization.

Which of the following statement is true about the statement below? DECLARE String names[3] = "Mike", "Jane", "Mary"

This expression is true for numbers between 0 and 100.

Which of the following statements is true about the Boolean expression in Line2? 1. DECLARE Real number 2. IF number >= 0 and number <= 100 3. ...

Do-While and Do-Until

Which of these are posttest loops?

None of these

Which operator is used to determine that the operands are not exactly of the same value?

While and Do-While

Which pair of loops causes a statement or set of statements to repeat as long as a condition is true?

None of these

Which relational operator is best to determine whether x contains a value in the range of 10 through 57?

Binary

Which search algorithm uses three variables to mark positions within the array as it searches for the searchValue?

Binary

Which searching algorithm requires the array to be ordered?

Bubble

Which sorting algorithm moves elements to their final sorted position in the array?

Insertion

Which sorting algorithm sorts the first two elements of an array before inserting the remaining elements into that sorted part of the array?

x and y swapped their values

Which statement is true after the execution of the following statements? SET temp = x SET x = y SET y = temp

x contains the value in y and y stayed the same

Which statement is true after the execution of the following statements? SET x = y SET y = x

Control

Which structure is a logical design that controls the order in which a set of statements executes?

Processing

Which symbol is used for an assignment statement in a flowchart?

Direct access

Which type of data file access allows access to any piece of data in the file without reading the data that comes before it?

Sequential access

Which type of data file access starts from the beginning of the file and proceeds to the end of the file?

Global

Which type of variable is visible to every module and the entire program?

Parallel

________ arrays are two or more arrays that hold related data, and the elements are accessed using a common subscript.

Block

________ comments take up several lines and are used when lengthy explanations are required in the program.

Boolean

________ expressions are named in honor of mathematician George Boole.

Error trap

________ is sometimes the term used for input validation.

Sequence

A ________ structure is a set of statements that execute in the order they appear.

counter variable

A count-controlled loop uses a variable known as ________ to store the number of iterations that it has performed.

Running total

A loop that accumulates a total as it reads each number from a series is often said to keep a what?


Conjuntos de estudio relacionados

Saunders - Ethical & Legal Questions w/ Rationale

View Set

Honors Biology Final Review (Mr.Hunt)

View Set

Contracting Officer warrant board questions current

View Set

The Laws of Conservation of Mass

View Set

Chapter 8 Review Questions, Guide to Networking Essentials Seventh Edition

View Set