ITP 100 MidTerm

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

A(n) ________________________________ is a special value that signals when there are no more items from a list of items to be processed. This value cannot be mistaken as an item from the list. a. sentinel b. flag c. signal d. accumulator

sentinel

Chapter 3: Programming languages typically require that arguments be of the same data type as the parameters that they are passed to. a. True b. False

a. True

Chapter 3: When an argument is passed by reference, the module can modify the argument in the calling part of the program. b. False

a. True

Chapter 3. A(n) ____________ is a piece of data that is sent into a module. a. argument b. parameter c. header d. packet

a. argument

Each element in an array must have the same _____ as the others. a. data type b. subscript c. value d. memory location

a. data type

Validation loops are also known as a. error traps b. doomsday loops c. error avoidance loops d. defensive programming loops

a. error traps

Parallel arrays _____. a. frequently have an indirect relationship b. never have an indirect relationship c. must be the same data type d. must not be the same data type

a. frequently have an indirect relationship

Chapter 6: This part of a function definition specifies the data type of the value that the function returns. a. header (also known as the b. signature) b. footer c. body d. return statement

a. header (also known as the b. signature)

The subscripts of any array are always _____. a. integers b. fractions c. characters d. strings of characters

a. integers

Each element in a seven-element array can hold _____ value(s). a. one b. seven c. at least seven d. an unlimited number of

a. one

Chapter 3: When _____________ , the module can modify the argument in the calling part of the program. a. passing an argument by reference b. passing an argument by name c. passing an argument by value d. passing an argument by data types

a. passing an argument by reference

The For loop is a ___________ type of loop. a. pretest b. posttest c. prequalified d. post iterative

a. pretest

The While loop is a _________ type of loop. a. pretest b. postest c. prequalified d. post iterative

a. pretest

The symbols >, <, and ++ are all ____ operators. a. relational b. logical c. conditional d. ternary

a. relational

Look at the following pseudocode module header: Module myModule(Integer a, Integer h, Integer c) Now look at the following call to myModule: call myModule(3, 2, 1) When this call executes, the value of_____ will be stored in a, the value of____ will be stored in b, and the value___ of will be stored in c.

3, 2, 1

Chapter 6: This type of error occurs when you try to assign a value of one data type to a variable of another data type. a. type mismatch error b. Boolean logic error c. relational error d. bit conversion error

a. type mismatch error

Chapter 3: A group of statements that exist within a program for the purpose of performing a specific task is a(n) _______________. A. block B. parameter C. module D. expression

C. module

Chapter 3: After a module has been called and its statements have been executed, what happens when the end of the module is reached? A. the program ends B. the computer calls the main module C. the computer jumps back to the part of the program that called the module. D. the computer calls the next module in the list E. the computer jumps to that module and executes the statements in the module's body

C. the computer jumps back to the part of the program that called the module.

What happens when a module is called? A. the program ends B. the computer calls the main module C. the computer jumps back to the part of the program that called the module. D. the computer calls the next module in the list E. the computer jumps to that module and executes the statements in the module's body

E. the computer jumps to that module and executes the statements in the module's body

A syntax error does not prevent a program from being compiled and executed. A. True B. False

False

Assembly language is considered a high-level language. A. True B. False

False

Images, like the ones you make with your digital camera, cannot be stored as binary numbers. A. True B. False

False

Today, CPUs are huge devices made of electrical and mechanical components such as vacuum tubes and switches. A. True B. False

False

Windows Vista, Linux, UNIX, and MAC OS X are all examples of application software. A. True B. False

False

Word processing programs, spreadsheet programs, email programs, Web browsers, and games are all examples of utility programs. A. True B. False

False

In most modern programming languages, the highest subscript you should use with a 12-element array is _____. a. 10 b. 11 c. 12 d. 13

b. 11

What data type does the isInteger() function return? a. integer b. Boolean c. String d. None of these

b. Boolean

A(n) ___ section of a Select Case statement is branched to if none of the case values match the expression listed after the Select statement. a. Else b. Default c. Case d. otherwise

b. Default

Chapter 3: A statement in one module can access a local variable in another module. a. True b. False

b. False

Chapter 3: Module names should be as short as possible. a. True b. False

b. False

Chapter 3: Most languages do not allow you to write modules that accept multiple arguments. a. True b. False

b. False

The approach of using a posttest validation loop shown in this chapter requires a priming read. a. True b. False

b. False

The priming read appears inside the validation loop. a. True b. False

b. False

The process of input validation works like this: When the user of a program enters invalid date, the program should ask the user, "Are you sure you meant to enter that?" If the user answers "yes" the program should accept the data. a. True b. False

b. False

You use a(n) ___ statement in pseudocode to write a single alternative decision structure. a. Test-Jump b. If-Then c. If-Then-Else d. If-Call

b. If-Then

A ____________ - controlled loop uses a true/false condition to control the number of times that it repeats. a. Boolean b. condition c. decision d. count

b. condition

In pseudocode, the if-Then statement is an example of a ___. a. sequence structure b. decision structure c. pathway structure d. class structure

b. decision structure

GIGO stands for a. great input, great output b. garbage in, garbage out c. GIGahertz, Output d. GIGabyte, Operation

b. garbage in, garbage out

Chapter 3: When possible, you should avoid using _________________ variables in a program. a. local b. global c. reference d. parameter

b. global

What do you call two arrays in which each element in one array is associated with the element in the same relative position in the other array? a. cohesive arrays b. parallel arrays c. hidden arrays d. perpendicular arrays

b. parallel arrays

Chapter 3: A(n) ____________ is a special variable that receives a piece of data when a module is called. a. argument b. parameter c. header d. packet

b. parameter

A ______ loop always executes at least once. a. pretest b. postest c. condition-controlled d. count-controlled

b. postest

The Do-While loop is a ______________________type of loop. a. pretest b. posttest c. prequalified d. post iterative

b. posttest

A ___ structure provides one alternative path of execution. a. sequence b. single alternative decision c. one path alternative d. single execution decision

b. single alternative decision

Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know that _____. a. numbers[4] is larger than numbers[1] b. the array has at least five elements c. the array has been initialized d. the two elements are three bytes apart in memory

b. the array has at least five elements

Chapter 6: This is an example of a data type conversion function. a. sqrt b. toReal c. substring d. isNumeric

b. toReal

You use a(n) ___ statement in pseudocode to write a dual alternative decision structure. a. Test-Jump b. If-Then c. If-Then-Else d. If-Call

c. If-Then-Else

Chapter 6: This part of a function definition is comprised of one or more statements that are executed when the function is called. a. header (also known as the signature) b. footer c. body d. return statement

c. body

A ____ structure can execute a set of statements only under certain circumstances. a. sequence b. circumstantial c. decision d. Boolean

c. decision

A(n) ___ structure tests a condition and then takes one path if the condition is true, or another path if the condition is false. a. If-Then statement b. single alternative decision c. dual alternative decision d. sequence

c. dual alternative decision

A(n) ______ loop has no way of ending and repeats until the program is interrupted. a. indeterminate b. interminable c. infinite d. timeless

c. infinite

The integrity of a program's output is only as good as the integrity of the program's _________________________. a. compiler b. programming language c. input d. debugger

c. input

Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0. Which of the following is an allowed operation? a. values[4] = 80 b. values[2] = values[4] - values[0] c. output values[3] d. all of the above

c. output values[3]

Chapter 3: When _____________ , only a copy of the argument's value is passed into the parameter variable. a. passing an argument by reference b. passing an argument by name c. passing an argument by value d. passing an argument by data types

c. passing an argument by value

Filling an array with values during a program's execution is known as _____ the array. a. executing b. colonizing c. populating d. declaring

c. populating

Chapter 3: The ___________ is the part of a program in which a variable may be accessed. a. declaration space b. area of visibility c. scope d. mode

c. scope

Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know that _____. a. the two elements hold the same value b. the array holds exactly four elements c. there are exactly two elements between those two elements d. the two elements are at the same memory location

c. there are exactly two elements between those two elements

Suppose you have declared a numeric array named values that has 13 elements. Which of the following must be true? a. values[0] is smaller than values[1] b. values[2] is stored adjacent to values[4] c. values[13] is out of bounds d. values[12] is the largest value in the array

c. values[13] is out of bounds

A(n) ___ expression has a value of either true or false. a. binary b. decision c. unconditional d. Boolean

d. Boolean

Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0. Which of the following is an allowed operation? a. values[2] = 17 b. input values[0] c. values[3] = values[0] + 10 d. all of the above

d. all of the above

Chapter 3: In most languages, where does a local variable's scope begin and end? a. begins at the beginning of the module and ends at the end of module in which the variable is declared b. begins at the beginning of the program and ends at the end of the program c. begins at the variable's declaration and ends at the end of the program d. begins at the variable's declaration and ends at the end of module in which the variable is declared

d. begins at the variable's declaration and ends at the end of module in which the variable is declared

A _______- controlled loop repeats a specific number of times. a. Boolean b. condition c. decision d. count

d. count

A _____ is a variable that can be set to indicate whether some event has occurred. a. subscript b. banner c. counter d. flag

d. flag

Chapter 3: A variable that is visible to every module in the program is a(n) _________________ . a. local variable b. universal variable c. program-wide variable d. global variable

d. global variable

Each repetition of a loop is known as a(n) ______________________________. a. cycle b. revolution c. orbit d. iteration

d. iteration

A ___ structure allows you to test the value of a variable or an expression and then use that value to determine which statement or set of statements to execute. a. variable test decision b. single alternative decision c. dual alternative decision d. multiple alternative decision

d. multiple alternative decision

A subscript is a(n) _____. a. element in an array b. alternate name for an array c. number that represents the highest value stored within an array d. number that indicates the position of an array element

d. number that indicates the position of an array element

The input operation that appears just before a validation loop is known as the a. prevalidation read b. primordial read c. initialization read d. priming read

d. priming read

Suppose that you want to write a program that inputs customer data and displays a summary of the number of customers who owe more than $1000 each, in each of 12 sales regions. Customer data variables include name, zipCode, balanceDue, and regionNumber. At some point during record processing, you would add 1 to an array element whose subscript would be represented by _____. a. name b. zipCode c. balanceDue d. regionNumber

d. regionNumber

Chapter 6: This statement specifies the value that is returned from the function when the function ends. a. end b. send c. exit d. return

d. return

Chapter 6: This term describes any mechanism that accepts input, performs some operation that cannot be seen on the input, and produces output. a. glass box b. white box c. opaque box d. black box

d.black box

Chapter 3: The benefit(s) of using modules is / are : (CHECK ALL THAT APPLY) a. the code tends to be easier to understand b. using modules promotes code reuse, which will reduce the duplication of code within the program c. modules can be tested and debugged individually which will lead to better overall testing of the code d. it allows for easier facilitation of team work - each module can be assigned to a different developer

ALL OF THE ABOVE

Chapter 3: You ____________ the module to execute it. A. define B. call C. import D. export

B. Call

Chapter 3: A ____________ is a variable that is declared inside a module. A. global variable B. local variable C. hidden variable D. none of the above; you cannot declare a variable inside a module

B. local variable

An interpreter is a program that both translates and executes the instructions in a high-level language program. A. True B. False

True

Any piece of data that is stored in computer's memory must be stored as a binary number. A. True B. False

True

Machine language is the only language that a CPU understands. A. True B. False

True

Main memory is also known as RAM. A.True B.False

True


Set pelajaran terkait

HISTORY & THEMES VIDEO QUIZ: The Pyramids of Giza

View Set

Chapter 13, users , groups and permissions 1002

View Set

Biochemistry CH4: Carbohydrate structure + function

View Set