Introduction to Computer Programming

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

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

AND

Which logical operator would make the following expression false? True __________ False

AND

Which operator would make the following expression false? True ________ False

AND

what two logical operators perform short circuit evaluation?

AND and OR

List the logical operators

AND, OR, NOT

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

ASCII

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

ASCII

Programs that make a computer useful for everyday tasks are known as ___________.

Application Software

Programs that make a computer useful for everyday tasks are known as ________________.

Application Software

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

Array

When working with arrays, most programming languages perform _______________, which means they do not allow programs to use invalid subscripts.

Array bounds checking

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

Assembly

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

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?

Binary

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

Binary file

The module definition comprises the module header and the module ____________.

Body

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

Boolean Function

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

Condition-Controlled

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

Control

The following is an example of what type of loop? For k - 7 to maxValue

Count-controlled loop

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

Declare Real retailPrice[SIZE]

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

Diamond

What term can be used to describe anything that uses binary numbers?

Digital

Which loop is specifically designed to initialize, test, and increment a counter variable?

Do-Until

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

Do-Until

Which of these are posttest loops?

Do-While and Do-Until

_________________ happens when an input operation attempts to read data, but there is no data to read.

Empty input

________________ is sometimes the term used for input validation.

Error Trap

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

Executes and Translates

The following is an example of a module __________. Call showNetPay()

Execution

_______________ was the first high-level programming language designed that could perform complex mathematical calculations.

FORTRAN

Arrays, like variables, can only hold one value at a time.

False

Data files are less and less needed in current gaming software.

False

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

False

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

False

Suppose A = True and B = False, what is the result of the following expression (A or B) AND (! B) AND (B AND A)?

False

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

False

True or 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.

False

True or False All types of data files are viewable in a text editor.

False

True or False An IF statement will produce unpredictable results if the programmer does use proper indentations in pseudocode

False

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

False

True or False Computers are designed to do just one job

False

True or False In the For statement, you can only use positive integers as step values

False

True or False Modules make it impossible for programmers to work in teams.

False

True or False Most programs written in a high-level language need to be translated into machine language.

False

True or False The While loop will never execute if its condition is true to start with

False

True or False The scope of the parameter variables is the entire program and it is visible to any statement in the program.

False

True or False The swap module is executed with three arguments to correctly swap the elements in an array.

False

True or False The term " output file" is used to describe a file that data is read from.

False

True or False The term software refers to all the physical devices, or components, that a computer is made of.

False

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

False

True or False? A bit that is turned off is represented by the value -1

False

True or False? Computer programming languages are only able to perform sort algorithms on numeric arrays.

False

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

False

True or False? Modules make it impossible for programmers to work in teams.

False

True or False? Most programs written in a high-level language need to be translated into machine language.

False

True or False? The Diamond symbol is used to represent the inputs and outputs in the steps of the program.

False

True or False? The While loop gets its name from the way it works: While a condition is false, do some task.

False

True or False? The biggest advantage of the bubble sort algorithm is that value move only by one element at a time toward their final destination in the array.

False

True or False? The direct access file is similar to the way an MP3 player works: the player starts from the beginning.

False

True or False? The sequential search algorithm is simple and most efficient to use with a large data array.

False

True or False? The term "input file" is used describe a file that data is written to

False

If array name contains a list of names, name[1] is the name of the first person.

False.

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

False.

True or False. The short-circuit evaluation is performed with expressions containing any logical operators.

False.

True or False? A post test loop does not perform any iteration if the Boolean expression is false to begin with.

False.

True or False? Computers are designed to do just one job.

False.

Unlike variables, arrays need to be initialized separately from the declaration.

False.

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

Fetch-decode-execute

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

For

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

For

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

For Each

Which loop is specifically designed to initialize, test, and increment a counter variable?

For loop

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

Global

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

Hierarchy charts

What is the output of the following pseudocode Set dollars = 2.75 Display "I have ", dollars, "in my account."

I have 2.75 in my account.

Name input validation error types

Inaccurate data, empty input, incorrect data type

How many times will the following loop iterate? Set k = 1 While k < = 5 Display k End While

Infinite

How many times will the following loop iterate? Set k = 1 while k <= 5 Display k End While

Infinite

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

Input file

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

Insertion

In the following declaration, what is the data type of the elements of the array? Declare Integer numbers [SIZE]

Integer

Name the three variable types

Integer, Real, String

Which computer language does this code represent? 10110000

Machine Language

The disk drive is a secondary device that stores data by magnetically encoding it onto circular disks.

Magnetically

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

Microsoft Word

Function is another name for ______________.

Module.

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

NOT

The ___________ operator is unary operator as it works with only one operands

NOT

What operator reverses the logic of its operand?

NOT

Which of the logical operators reverses the logic of its operand?

NOT

if the expression is false, the _____________ operator will return true.

NOT

Name the three logical operators

NOT, AND, OR

What phrase is placed in the starting terminal symbol of a module in a flowchart?

Name of the module

How many times will the following loop iterate? Set k = 1 while k > 5 Display k End While

No iterations.

What is the result of adding 1 to the following binary number 0111 0000 1110 1111 or None of these?

None of these

Which operator would make the following expression true? False __________ True

OR

What type of error occurs when a loop iterates one time too few or one time too many?

Off-by-one error

What is the subscript for the data value 92 in the example given below? Declare Integer score [5] = 83, 92, 78, 94, 71

One

Data is not recorded magnetically on a(n) ___________, but is encoded as a series of pits on the disk surface.

Optical disk

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

Output

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

Pages

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

Parallel

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

Priming read

Modules are commonly called what?

Procedures, subroutines, subprograms.

If, when asked for a date of birth, the user enters a future date, this error should be caught by a _____________ check.

Reasonableness

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

Rectangle

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

Rectangle

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

Reference

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

Relational (=,<,>,!=,<=,>=)

Which structure causes a statement or set of statement to execute repeatedly?

Repetition

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

Return point

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

Rows and columns

The expression score[5] is pronounced _________________.

Score sub 5

The _________ represents a special value that marks the end of a list of values.

Sentinel

Consider the following statement: "A store is giving a 30% for all purchases of over $100" Which of the following is not the appropriate structure to use to program the statement? Control, decision, selection, or sequence?

Sequence.

Benefits to using module?

Simpler Code, Faster Development, Code Reuse

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

Size declarator

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

Subscript

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

Subscripts

The term used for a set of rules that must be strictly followed when writing a program is ___________.

Syntax

The term used for a set of rules that must be strictly followed when writing a program is:

Syntax

Give examples of a computer

Tablets, GPS systems, Smartphones, Video game consoles.

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

Text file

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

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

What is the output of the following pseudocode Set price = 100 Set discount = 20 Set sale = price - discount Display "The total cost is $", sale

The total cost is $80

What is true about this Boolean expression? score < 0 AND score > 100

This expression would never be true.

What is true about the statement below? Declare Integer score [5] = 83, 92, 78, 94, 71

This is an array declaration and initialization

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

Three

How many time will the following loop iterate? For j = 1 to 5 Step 2 Display j End For

Three

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

Translates and Execute

A While loop repeats infinitely when there is no statement inside the loop body that makes the test condition false.

True

An input validation loop is sometimes called an error handler.

True

Multiple-dimensional arrays can be used to model data that occurs in multiple sets.

True

Suppose A=True and B=False what is the result of the following expression (A OR B) AND (! B)?

True

The conditions that control a loop repetition are Boolean expressions.

True

The priming read is needed when a pretest loop is executed.

True

True or False A computer is not a single device, but a system of devices that work together to manipulate data according to the instructions provided.

True

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

True

True or False Decision structures are also known as selection structures

True

True or False Each instruction written in a high-level programming language is called a statement.

True

True or False The CPU understands instructions in machine language, which are written in binary.

True

True or False The RAM is a volatile memory used for temporary storage while a program is running

True

True or False The While and For loops are considered pretest loops because they test the condition before processing the statement(s) in the loop body.

True

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

True

True or False The conditions that control a loop repetition are Boolean expressions.

True

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

True

True or False The main reason for using secondary storage is to hold data for long periods of time, even when the power to the computer is turned off.

True

True or False The top-down design process is sometimes called stepwise refinement.

True

True or False A condition controlled loop can be used to iterate the body of the loop a specific number of times.

True

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

True

True or False The While loop is known as a pretest loop, which means it tests its condition before performing an iteration.

True

True or False? A nested decision structure can be used to test more than one condition.

True

True or False? A sequence of characters that is used as data is called a string in programming

True

True or False? Any loop that can be written as a Do-While loop can also be written as a While loop.

True

True or False? Array bounds checking happens at runtime, which is while the program is running.

True

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

True

True or False? In a sequential search, each element is compared to the searchValue and the search stops when the value is found or the end of array is encountered.

True

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

True

True or False? Swapping the contents of two variables requires a third variable that can serve as a temporary storage location.

True

True or False? The data in an array can be sorted in either ascending or descending order.

True

True or False? The first step in calculating the average of the values in an array is to get the total of the values.

True

True or False? The sequential access file is similar to the way a cassette player works.

True

True or False? The use of a buffer increases the system's performance because writing data to memory is faster than writing to a disk.

True

True or False? To calculate the total of the values in an array, a loop is used with an accumulator variable.

True

True or False? Variables work well in many situations, but they have limitations.

True

True or False? When processing the data in a two-dimensional array, each element has two subscripts.

True

True or False? 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

True

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

Two

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

Twos complement

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

Value

When an argument is passed by _________, it is not affected by a change of the content of the parameter variable.

Value

Give examples of operating systems

Windows, Mac OS X, Linux

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

Writing data to

A computer system contains

a central processing system, main memory, input devices, and output devices.

A partially filled array is normally used with ________________.

a library function that performs array insertions

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

bit

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

bit

which operator is used to determine that the operands are not exactly of the same value? !, =!, or ==

none

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

processing

What is the term used for the value that is searched for in a search algorithm?

searchValue

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

toUpper

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

x and y swapped their values

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

x contains the value in y and y stayed the same

What is the decimal equivalence for the following binary number 1101?

13

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

15

What is the largest value that can be stored in one byte?

255

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

!=

What is the negative equivalence for the following binary number 1111?

0000

What is the negative equivalence for the following binary number 1011?

0101

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

cookie

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

isReal

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

logic


Conjuntos de estudio relacionados

Bio 103 Ch 25 Bacteria and Archaea

View Set

Ch. 12 muscular analysis of selected exercises and related concepts

View Set