ITP 100 Software Development Book/Quiz 1,2,3,4

Ace your homework & exams now with Quizwiz!

A bit that is turned off represents the following value: . 1 −1 0 "no"

0

What will the following pseudocode program display? Module main() Declare Integer x = 1 Declare Real y = 3.4 Display x, " ", y Call changeUs(x, y) Display x, " ", y End Module Module changeUs(Integer a, Real b) Set a = 0 Set b = 0 Display a, " ", b End Module

1, 3.4 0, 0 1, 3.4

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, the value of _______ will be stored in c.

3 2 1

What is the difference between a compiler and an interpreter?

A compiler translates high-level language into machine language. An interpreter not only does the latter, yet it can do it while a programmer is creating the code ("on the fly").

Explain what is meant by the term conditionally executed.

A conditionally executed statement is performed only when a certain condition is true.

What would you call a device that works with binary data?

A digital device

You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use?

A duel alternative decision structure

What is a flag and how does it work?

A flag is a variable that singnal when some condition exists in the program. When the flag variable is set to False, it indicates the condition does not exist. When tha flag variable is set to True, it means the condition does exist.

What is a local variable? What statements are able to access a local variable?

A local variable is a variable that is declared inside a module. It belongs to the module in which it is declared, and only statements inside the same module can access it.

What does a professional programmer usually do first to gain an understanding of a problem?

A professional programmer will do the following to gain an understanding of a problem: Work closely with the customer to understand what the program is meant to accomplish. Determine the steps that must be taken to perform the task(s) utilizing a flowchart. Determine program requirements. Write pseudocode to examine the order of operations.

A compound Boolean expression created with the _______ operator is true only if both of its subexpressions are true. AND OR NOT BOTH

AND

Which operator would make the following expression false? True_________Falce AND NOT OR All of these None of these

AND

The ________ operator could be used, in some situations, to simplify nested selection structures. AND NOT OR All of these None of these

AND 1 // Declare variables 2 Declare Real salary, yearsOnJob 3 4 // Get the annual salary. 5 Display "Enter your annual salary." 6 Input salary 7 8 // Get the number of years on the current job. 9 Display "Enter the number of years on your ", 10 "current job." 11 Input yearsOnJob 12 13 // Determine whether the user qualifies. 14 If salary >= 30000 AND yearsOnJob >= 2 Then 15 Display "You qualify for the loan." 16 Else 17 Display "You do not qualify for this loan." 18 End If

Which operator is best to determine whether x contains a value in the range of 10 through 57? AND NOT OR == None of these

AND When determining whether a number is inside a range, it is best to use the AND operator. For example, the following If-Then statement checks the value in x to determine whether it is in the range of 20 through 40: If x >= 20 AND x <= 40 Then Display "The value is in the acceptable range." End If

What two logical operators perform short-circuit evaluation? NOT and OR AND and OR AND and NOT All of these None of these

AND and OR Here's how it works with the AND operator: If the expression on the left side of the AND operator is false, the expression on the right side will not be checked. Because the compound expression will be false if only one of the subexpressions is false, it would waste CPU time to check the remaining expression. So, when the AND operator finds that the expression on its left is false, it short-circuits and does not evaluate the expression on its right.

A set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters is . binary numbering ASCII Unicode ENIAC

ASCII

Which of the following is a logical operator? AND NOT OR All of these None of these

All of these

How do modules help you to reuse code in a program?

Because you are writing a code to perform a specific task and these tasks can be duplicated over and over again.

A condition is a ________ expression. Boolean Relational Logical Mathematical None of these

Boolean

A(n) _________ expression has a value of either true or false. binary decision unconditional Boolean

Boolean

Assume that a pseudocode program contains the following module: Module display(Integer arg1, Real arg2, String arg3) Display "Here are the values:" Display arg1, " ", arg2, " ", arg3 End Module Assume that the same program has a main module with the following variable declarations: Declare Integer age Declare real income Declare String name Write a statement that calls the display module and passes these variables to it.

Call display (age, income, name)

Examine the following pseudocode module header, and then write a statement that calls the module, passing 12 as an argument. Module showValue(Integer quantity)

Call showValue (12)

Computer programs typically perform what three steps?

Computer programs perform the following steps: Look for input Preform a process Direct an output

Which structure is a logical design that controls the order in which a set of statements executes? Control Sequence Module Terminal None of these

Control

What is the error in the following pseudocode? Module main() Call raiseToPower(2, 1.5) End Module Module raiseToPower(Real value, Integer power) Declare Real result Set result = value^power Display result End Module

Data types must be labeled/declared correctly to be passed forward. Thus, in the raiseToPower module, 2 must be set as an integer and 1.5 must be set as real. Although some languages will allow you to mix data types, the programmer would have to set it up in a way where no data would be lost. However, in this example, the .5 would be lost so it still wouldn't work.

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. Else Default Case Otherwise

Default

The ________ symbol indicates that some condition must be tested in a flowchart. Rectangle Oval Parallelogram Square Diamond

Diamond

A flowchart shows the hierarchical relationships between modules in a program. T/F

F

A program can be made of only one type of control structure. You cannot combine structures. T/F

F

A single alternative decision structure tests a condition and then takes one path if the condition is true, or another path if the condition is false. T/F

F

A statement in one module can access a local variable in another module T/F

F

A statement in one module can access a local variable in another module. T/F

F

Calling a module and defining a module mean the same thing. T/F

F

Hand tracing is the process of translating a pseudocode program into machine language by hand. T/F

F

Internal documentation refers to books and manuals that document a program, and are intended for use within a company's programming department. T/F

F

Module names should be as short as possible. T/F

F

Most languages do not allow you to write modules that accept multiple arguments T/F

F

Most languages do not allow you to write modules that accept multiple arguments. T/F

F

Passing an argument by value is a means of establishing two-way communication between modules. T/F

F

Programmers must be careful not to make syntax errors when writing pseudocode programs. T/F

F

The name gross_pay is written in the camelCase convention. T/F

F

The phrase "divide and conquer" means that all of the programmers on a team should be divided and work in isolation. T/F

F

Variable names can have spaces in them. T/F

F

You can write any program using only sequence structures. T/F

F

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

False

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

False

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

False

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

False

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

False

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

False

Why do global variables make a program difficult to debug?

Global variables make debugging difficult. Any statement in the program can change the value of the global variable. Modules that use global variables are usually dependent on those variables. Global variables make a program hard to understand.

What value is stored in uninitialized variables?

If a variable is uninitialized, we do not know what the value will be. For example, the value will be whatever the language has stored in memory. As a result, an uninitialized variable holds the value that happens to be stored in its memory location.

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

If-Then

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

If-Then-Else

Why is the CPU the most important component in a computer?

It is the brain of the computer and preforms all of the processing tasks.

What are the words that make up a high-level programming language called?

Keywords

A ________ error does not prevent the program from running, but causes it to produce incorrect results. syntax hardware logic fatal

Logic

A group of statements that exist within a program for the purpose of performing a specific task is a(n)_______ . block parameter module expression

Module

Write the module called showCost that will accept the cost as a Real produces the following results: The cost is $59.99 You can assume that a main module exists and makes the following call: Module main() Declare Real x = 59.99 Call showCost(x) End Module

Module showCost (Real x) Display "The cost is $", x End module

A case structure is a ________ alternative decision structure. Single Dual Multiple Single or dual All of these

Multiple

If the expression is false, the ________ operator will return true. AND NOT OR All of these None of these

NOT

The _______ operator takes a Boolean expression as its operand and reverses its logical value. AND OR NOT EITHER

NOT

The ________ operator is a unary operator, as it works with only one operand. AND NOT OR All of these None of these

NOT

Which of the following operators reverses the logic of its operand? NOT AND OR All of these None of these

NOT The NOT operator is a unary operator, meaning it works with only one operand. The operand must be a Boolean expression. The NOT operator reverses the truth of its operand. If it is applied to an expression that is true, the operator returns false. If it is applied to an expression that is false, the operator returns true.

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

None of these

A compound Boolean expression created with the ________ operator is true if either of its subexpressions is true. AND OR NOT EITHER

OR

What number does a bit that is turned on represent? What number does a bit that is turned off represent?

On =1 Off =0

What is the difference between passing an argument by value and passing it by reference?

Passing an argument by value means that only a copy of the argument's value is passed into the parameter variable. If the contents of the parameter variable are changed inside the module, it has no effect on the argument in the calling part of the program. Passing an argument by reference means that the argument is passed into a special type of parameter known as reference variable. When a reference variable is used as a parameter in a module, it allows the module to modify the argument in the calling part of the program.

This is a volatile type of memory that is used only for temporary storage while a program is running. RAM secondary storage the disk drive the USB drive

RAM

What type of operator can be used to determine whether a specific relationship exists between two values? Boolean Relational Logical Mathematical None of these

Relational

What type of operators are the following? > < >= <= == != Boolean Relational Logical Mathematical None of these

Relational

In many languages the case structure is called a ________ statement. Branch Jump Selective Switch All of these

Switch

What type of software controls the internal operations of the computer's hardware?

System software controls the internal operations of a computer. It includes operating systems, utility and software development programs.

A compound Boolean expression created with the AND operator is true only when both subexpressions are true. T/F

T

A decision structure can be nested inside another decision structure. T/F

T

A hierarchy chart does not show the steps that are taken inside a module. T/F

T

In a math expression, multiplication and division take place before addition and subtraction. T/F

T

In languages that require variable declarations, a variable's declaration must appear before any other statements that use the variable. T/F

T

In most languages, the first character of a variable name cannot be a number. T/F

T

In most programming languages, you cannot have two variables with the same name in the same scope. T/F

T

Modules make it easier for programmers to work in teams. T/F

T

Programming languages typically require that arguments be of the same data type (Integer, Real or String) as the parameters that they are passed to. T/F

T

Programming languages typically require that arguments be of the same data type as the parameters that they are passed to. T/F

T

The value of a named constant cannot be changed during the program's execution. T/F

T

Uninitialized variables are a common cause of errors. T/F

T

When an argument is passed by reference, the module can modify the argument in the calling part of the program. T/F

T

When determining whether a number is inside a range, which logical operator is it best to use?

The AND operator

Briefly describe how the AND operator works.

The AND operator connects two Boolean expressions into one compound expression. Both subexpressions must be true for the compound expression to be true.

Briefly describe how the OR operator works.

The OR operator connects two Boolean expressions into one compound expression. One or both subexpressions must be true for the compound expression to be true. It is only necessary for one of the expressions to be true, and it does not matter which.

If you need to test the value of a variable and use that value to determine which statement or set of statements to execute, which structure would be the most straightforward to use?

The case structure which is a multiple alternative decision structure

What is pseudocode?

The pseudo prefix comes from the Greek meaning fake or false. Thus, the word pseudocode means fake code. However, pseudocode is the first step in designing new software. It allows the developer to develop a program without worrying about syntax errors. It also allows her/him to examine the program as a whole before writing the actual code.

What does the term user-friendly mean?

The term user-friendly refers to programs that are easy to use. These programs usually have: Easy to understand instructions Input prompt explanations Input order-of-operation explanations

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

True

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

True

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

True

Main memory is also known as RAM. True False

True

What two things must you normally specify in a variable declaration?

Two things specified in a variable declaration: The variable's name The variable's data type

An extensive encoding scheme that can represent the characters of many of the languages in the world is . binary numbering ASCII Unicode ENIAC

Unicode

When a module is executing, what happens when the end of the module is reached?

When the end of the module is reached, the computer jumps back to the part of the program that called the module, and the program resumes execution at that point.

In most languages, where does a local variable's scope begin and end?

Within its own module

If you were to look at a machine language program, you would see __________ . Java code a stream of binary numbers English words circuits

a stream of binary numbers

A(n)_______ is a set of well-defined logical steps that must be taken to perform a task. logarithm plan of action logic schedule algorithm

algorithm

A component that collects data from people or other devices and sends it to the computer is called_____________. an output device an input device a secondary storage device main memory

an input device

A(n)__________ is a piece of data that is sent into a module. argument parameter header packet

argument

A(n)___________ is a piece of data that is sent into a module. argument parameter header packet

argument

The _________ translates an assembly language program to a machine language program. assembler compiler translator interpreter

assembler

A(n)_______ sets a variable to a specified value. variable declaration assignment statement math expression string literal

assignment statement

In a(n) _______ numbering system, all numeric values are written as sequences of 0s and 1s. hexadecimal binary octal decimal

binary

A byte is made up of eight . CPUs instructions variables bits

bits

A _______ is enough memory to store a letter of the alphabet or a small number. byte bit switch transistor

byte 1 byte=8 bits

You _________ the module to execute it. define call import export

call

You_________the module to execute it. define call import export

call

A benefit of using modules that helps to reduce the duplication of code within a program is_________. code reuse divide and conquer debugging facilitation of teamwork

code reuse

A benefit of using modules that helps to reduce the duplication of code within a program is______________ . code reuse divide and conquer debugging facilitation of teamwork

code reuse

Short notes placed in different parts of a program, explaining how those parts of the program work, are called___________. comments reference manuals tutorials external documentation

comments

A(n)_______ program translates a high-level language program into a separate machine language program. assembler compiler translator utility

compiler

A ________ structure can execute a set of statements only under certain circumstances. sequence circumstantial decision Boolean

decision

In pseudocode, the If-Then statement is an example of a __________. sequence structure decision structure pathway structure class structure

decision structure

In the part of the fetch-decode-execute cycle, the CPU determines which operation it should perform. fetch decode execute immediately after the instruction is executed

decode

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

dual alternative decision

A(n) __________ operator raises a number to a power. modulus multiplication exponent operand

exponent

A _________ is a Boolean variable that signals when some condition exists in the program. flag signal sentinel siren

flag

Real numbers are encoded using the __________ technique. two's complement floating-point ASCII Unicode

floating-point

A ______ is a diagram that graphically depicts the steps that take place in a program. flowchart step chart code graph program graph

flowchart

When possible, you should avoid using ______ variables in a program. local global reference parameter

global

When possible, you should avoid using _________ variables in a program. local global reference parameter

global

A variable that is visible to every module in the program is a _________. local variable universal variable program-wide variable global variable

global variable

A variable that is visible to every module in the program is a ___________ . local variable universal variable program-wide variable global variable

global variable

A debugging process in which you imagine that you are the computer executing a program is called . imaginative computing role playing mental simulation hand tracing

hand tracing

The physical devices that a computer is made of are referred to as_____. hardware software the operating system tools

hardware

The first line of a module definition is known as the . body introduction initialization header

header

The first line of a module definition is known as the ___________. body introduction initialization header

header

Name and describe the two parts that a module definition has in most languages.

header and a body. The header indicates the starting point of the module, and the body is a list of statements that belong to the module.

A __________ is a diagram that gives a visual representation of the relationships between modules in a program. flowchart module relationship chart symbol chart hierarchy chart

hierarchy chart

A __________is a diagram that gives a visual representation of the relationships between modules in a program. flowchart module relationship chart symbol chart hierarchy chart

hierarchy chart

Assigning a value to a variable in a declaration statement is called________. allocation initialization certification programming style

initialization

The words that make up a high-level programming language are called . binary instructions mnemonics commands key words

key words

A ________ is a variable that is declared inside a module. global variable local variable hidden variable none of the above; you cannot declare a variable inside a module

local variable

A ____________ is a variable that is declared inside a module. global variable local variable hidden variable none of the above; you cannot declare a variable inside a module

local variable

AND, OR, and NOT are __________ operators. relational logical conditional ternary

logical

Computers can only execute programs that are written in . Java assembly language machine language C++

machine language

The computer stores a program while the program is running, as well as the data that the program is working with, in_____________. secondary storage the CPU main memory the microprocessor

main memory

The part of a computer that runs programs is called__________. RAM secondary storage main memory the CPU

main memory

Today, CPUs are small chips known as___________. ENIACs microprocessors memory chips operating systems

microprocessors

What are the short words that are used in assembly language called?

mnemonics

A group of statements that exist within a program for the purpose of performing a specific task is a(n)___________ . block parameter module expression

module

A(n)_________ operator performs division, but instead of returning the quotient it returns the remainder. modulus multiplication exponent operand

modulus

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. variable test decision single alternative decision dual alternative decision multiple alternative decision

multiple alternative decision

A(n)__________is a variable whose content has a value that is read-only and cannot be changed during the program's execution. static variable uninitialized variable named constant locked variable

named constant

In the expression 12 + 7, the values on the right and left of the + symbol are called__________. operands operators arguments math expressions

operands

A video display is a(n)________ . output device input device secondary storage device main memory

output device

A(n) _______ is a special variable that receives a piece of data when a module is called. argument parameter header packet

parameter

A(n)___________is a special variable that receives a piece of data when a module is called. argument parameter header packet

parameter

When _________, the module can modify the argument in the calling part of the program. passing an argument by reference passing an argument by name passing an argument by value passing an argument by data type

passing an argument by reference

When____________ , the module can modify the argument in the calling part of the program. passing an argument by reference passing an argument by name passing an argument by value passing an argument by data type

passing an argument by reference

When __________, only a copy of the argument's value is passed into the parameter variable. passing an argument by reference passing an argument by name passing an argument by value passing an argument by data type

passing an argument by value

When ____________ , only a copy of the argument's value is passed into the parameter variable. passing an argument by reference passing an argument by name passing an argument by value passing an argument by data type

passing an argument by value

The tiny dots of color that digital images are composed of are called__________. bits bytes color packets pixels

pixels

A(n)________ is a set of instructions that a computer follows to perform a task. compiler program interpreter programming language

program

A(n) _________ is a message that tells (or asks) the user to enter a specific value. inquiry input statement directive prompt

prompt

An informal language that has no syntax rules, and is not meant to be compiled or executed is called . faux code pseudocode Java a flowchart

pseudocode

The symbols >, <, and == are all ________ operators. relational logical conditional ternary

relational

A __________ point is the memory address of the location in the program that the computer will return to when a module ends. termination module definition return reference

return

A___________point is the memory address of the location in the program that the computer will return to when a module ends. termination module definition return reference

return

A(n) ___________ is the part of a program in which a variable may be accessed. declaration space area of visibility scope mode

scope

A(n)__________ is the part of a program in which a variable may be accessed. declaration space area of visibility scope mode

scope

A type of memory that can hold data for long periods of time—even when there is no power to the computer--is called____________. RAM main memory secondary storage CPU storage

secondary storage

A(n)_______ is a set of statements that execute in the order that they appear. serial program sorted code sequence structure ordered structure

sequence structure

A _______ structure provides one alternative path of execution. sequence single alternative decision one path alternative single execution decision

single alternative decision

A _________is a single function that the program must perform in order to satisfy the customer. task software requirement prerequisite predicate

software requirement

A _________is a sequence of characters that is used as data. sequence structure character collection string text block

string

The rules that must be followed when writing a program are called . syntax punctuation key words operators

syntax

A design technique that programmers use to break down an algorithm into modules is known as . top-down design code simplification code refactoring hierarchical subtasking

top-down design

A design technique that programmers use to break down an algorithm into modules is known as ____________. top-down design code simplification code refactoring hierarchical subtasking

top-down design

Negative numbers are encoded using the technique. two's complement floating-point ASCII Unicode

two's complement

A(n)______ variable is one that has been declared, but has not been initialized or assigned a value. undefined uninitialized empty default

uninitialized

A ________ is any hypothetical person that is using a program and providing input for it. designer user guinea pig test subject

user

A _______ is a storage location in memory that is represented by a name. variable register RAM slot byte

variable

A(n) _________ specifies a variable's name and data type. assignment variable specification variable certification variable declaration

variable declaration


Related study sets

BIOL 1030 Chapter 11 Homework Questions

View Set

Unit 5: Baking and Pastry Applications

View Set

Chem Y8i - How many atoms are there all together in a single group of the following chemicals?

View Set

Chemistry Chapter 14 - Acids and Bases

View Set

BIOL 3030- Practice Test Chapter 16

View Set

Szerződések csoportosítása, tipizálása, klasszifikáció

View Set

APES test - Primary Productivity and Energy Flow

View Set