Which statement best describes a computer program?
- A program is a sequence of comments.
- A program can decide what task it is to perform.
- A program is a sequence of instructions and decisions
that the computer carries out.
- A program can only perform one simple task.
- Section Ref
- Section 1.1 Computer Programs
- Title
- Which statement best describes a computer program?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-01
Which statement regarding computer programs is correct?
- Computer programs can decide what task to perform.
- Large and complex computer programs are generally written by only one
programmer.
- Computer programs are composed of extremely primitive
operations.
- Small computer programs are not documented.
- Title
- Which statement regarding computer programs is correct?
- Section reference
- Section 1.1 Computer Programs
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-02
What is an example of a typical instruction in a computer program?
- Add up two numbers.
- Lay out a term paper.
- Drive a car.
- Display a fancy font.
- Title
- What is an example of a typical instruction in a computer program?
- Section reference
- Section 1.1 Computer Programs
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-03
What does CPU stand for?
- Computer Programming Unit
- Computer Processing Unit
- Central Processing Unit
- Central Programming Unit
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- What does CPU stand for?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-04
Which one of the following is NOT a function of a CPU?
- Performing arithmetic operations
- Processing data and controlling programs
- Querying a database
- Fetching and storing data from storage and input devices
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- Which one of the following is NOT a function of a CPU?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-05
Which type of storage is made from electronic circuits that can store data?
- compact disk (CD)
- hard disk
- primary storage
- secondary storage
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- Which type of storage is made from electronic circuits that can store data?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-06
Which one of the following memory types provides storage that persists
without electricity?
- primary storage
- RAM
- memory
- secondary storage
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- Which one of the following memory types provides storage that persists without electricity?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-07
Which one of the following memory types provides storage that is slower
and less expensive?
- primary storage
- secondary storage
- peripheral device
- the transistor
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- Which one of the following memory types provides storage that is slower and less expensive?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-08
Which type of secondary storage consists of rotating platters coated
with a magnetic material?
- hard disk
- solid state drive
- compact disk (CD)
- memory
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- Which type of secondary storage consists of rotating platters coated with a magnetic material?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-09
Some computers are self-contained units; others are interconnected through
what?
- bus
- networks
- peripheral devices
- power lines
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- Some computers are self-contained units; others are interconnected through what?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-10
Which is an example of a peripheral device?
- the CPU
- primary storage
- motherboard
- speakers
- Section Ref
- Section 1.2 The Anatomy of a Computer
- Title
- Which is an example of a peripheral device?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-11
Which memory type does not provide persistent storage?
- secondary storage
- hard disk
- primary storage
- DVD
- Title
- Which memory type does not provide persistent storage?
- Section reference
- 1.2 The Anatomy of a Computer
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-12
Where must program instructions and data reside in order for the CPU to
directly read and execute them?
- memory
- bus
- hard disk
- somewhere on the computer network
- Title
- Where must program instructions and data reside in order for the CPU to read and execute them?
- Section reference
- 1.2 The Anatomy of a Computer
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-13
What term is used to refer to the computer instructions that are
executed by a CPU?
- virtual machine
- machine code
- high-level code
- instruction set
- Section Ref
- Section 1.3 The Java Programming Language
- Title
- What term is used to refer to the computer instructions that are executed by a CPU?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-14
What is the Java Virtual Machine?
- A CPU that runs compiled Java code.
- A library that makes it possible to write portable programs.
- A program that simulates a real CPU running compiled Java code.
- A program that translates Java code into machine instructions.
- Title
- What is the JVM?
- Section reference
- 1.3 The Java Programming Language
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-15
What is the term used to refer to Java code that runs in a
browser?
- applet
- script
- html
- class
- Title
- What is the term used to refer to Java code that runs in a browser?
- Section reference
- 1.3 The Java Programming Language
- Difficulty
- easy
- id
- testbank-bj-6-ch01-16
What term is used to refer to languages that allow programmers to
describe tasks at a higher conceptual level than machine code?
- virtual
- high-level
- sophisticated
- conceptual
- Section Ref
- Section 1.3 The Java Programming Language
- Title
- What term is used to refer to languages that allow programmers to describe tasks at a higher conceptual level than machine code?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-17
What tool translates high-level instructions into low level machine code?
- debugger
- assembler
- compiler
- linker
- Section Ref
- Section 1.3 The Java Programming Language
- Title
- What tool translates high-level instructions into low level machine code?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-18
What tool translates Java source code into files that contain instructions
for the Java Virtual Machine?
- linker
- compiler
- assembler
- interpreter
- Section Ref
- Section 1.3 The Java Programming Language
- Title
- What tool translates Java source code into files that contain instructions for the Java Virtual Machine?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-19
Which statement is true about running a Java program on a different
CPU?
- You need different Java source code for each CPU.
- You can take code that has been generated by the Java
compiler and run it on different CPUs.
- You need to compile the Java program for each CPU.
- You cannot run the program on a different CPU because Java, being a high-level
programming language, is machine dependent.
- Section Ref
- Section 1.3 The Java Programming Langauge
- Title
- Which statement is true about running a Java program on a different CPU?
- Difficulty
- Medium
- id
- testbank-bj-6-ch01-20
When was Java officially introduced?
- 1991
- 1995
- 2000
- 2005
- Section Ref
- Section 1.3 The Java Programming Language
- Title
- When was Java officially introduced?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-21
Which statement best describes the portability characteristic of
Java?
- The same already-compiled Java programs will run on Windows,
UNIX, Linux, or Macintosh operating systems without any change.
- The same Java compiler can be used on many operating systems.
- There are only small differences between the Java programming language on
different operating systems.
- It is easy to change a Java program so that it will work on different
operating systems.
- Section Ref
- Section 1.3 The Java Programming Language
- Title
- Which statement best describes the portability characteristic of Java?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-22
No matter which Java development environment you use, what happens to the
Java source code in order for a Java program to execute?
- The source code is automatically separated into many files.
- The source code is backed up to a network storage facility.
- A Java compiler converts all uppercase letters to lowercase.
- A Java compiler translates the source code into class files.
- Title
- Â No matter which Java development environment you use, what happens to the Java source code in order for a Java program to execute?
- Section reference
- 1.4 Becoming Familiar With Your Programming Environment
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-23
Why should you set aside time to become familiar with the programming
environment?
- The time you spend will prevent data loss without the need for backups.
- The tools needed for Java programming are different from other
software.
- Although computer systems vary widely, the Java programming environment
is always the same.
- The Java libraries are detailed and extensive.
- Title
- Why should you set aside time to become familiar with the programming environment?
- Section reference
- 1.4 Becoming Familiar With Your Programming Environment
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-24
Suppose that a computer virus infects your computer and corrupts the
files you were going to submit for your current homework assignment. What
precaution could have saved you from a disastrously bad grade for this
assignment?
- Defragment the hard drive.
- Purchase an anti-virus program to remove the virus from your
computer.
- Make regular backups of all your important files.
- Purchase an extended warranty for your computer.
- Section Ref
- 1.4 Becoming Familiar With Your Programming Environment
- Title
- What can prevent you from losing files that get corrupted?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-25
Which statement regarding backup strategies for Java files is correct?
- You should have multiple copies of your source files
in different locations.
- You should regularly print out your work so you can retype it in case
of data loss.
- You should regularly back up the Java virtual machine instructions to
prevent loss of valuable work.
- Your compiler automatically makes backups of your source files.
- Title
- Which one of the following statements regarding backup strategies for Java files is correct?
- Section reference
- 1.4 Becoming Familiar With Your Programming Environment
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-26
The line public class HelloPrinter
indicates which
declaration below?
- Declaration of the variable
class
.
- Declaration of the class
HelloPrinter
.
- Declaration of the variable
public
.
- Declaration of the class
public
.
- Title
- The line public class HelloPrinter indicates which declaration below?
- Section reference
- 1.5 Analyzing Your First Program
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-27
Every Java program consists of one or more of these fundamental
building blocks.
- class
- CPU
- applet
- parameter
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- TB Every Java program consists of one or more of these fundamental building blocks.
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-28
What is the name of the file that contains the Java source code for
the public class HelloPrinter
?
HelloPrinter
HelloPrinter.java
HelloPrinter.class
HelloPrinter.txt
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What is the name of the file that contains the Java source code for this class?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-29
A __________ contains sequences of programming instructions that describe
how to perform a particular task.
- parameter
- label
- variable
- method
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- A __________ contains sequences of programming instructions that describe how to perform a particular task.
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-30
What term is used to refer to an individual instruction inside a method?
- statement
- constant
- comment
- object
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What term is used to refer to an individual instruction inside a method?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-31
In Java, every statement must end with which symbol?
.
)
!
;
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- In Java, every statement must end with this symbol.
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-32
What term is used to refer to a sequence of characters enclosed in
quotation marks?
- string
- object
- comment
- variable
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What term is used to refer to a sequence of characters enclosed in quotation marks?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-33
What term is used to refer to values supplied to a method that are needed to
carry out its task?
- class
- object
- argument
- comment
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What term is used to refer to values supplied to a method that are needed to carry out its task?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-34
Arguments supplied to methods are enclosed by which symbols?
()
" "
{}
//
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- Arguments supplied to methods are enclosed by which symbols?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-35
Whenever a method is called in Java, what must be specified?
- program name, method name
- strings, method name
- method name, arguments
- the main method, arguments
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- Whenever a method is called in Java, what must be specified?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-36
What is the syntax for calling the println
method on the
object System.out
?
println("Any message").System.out;
System.out("Any message").println;
System.out.println("Any message");
println(System.out,"Any message");
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What is the syntax for calling the println method on the object System.out?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-37
What is the name of the method in the given method call?
System.out.println("Welcome");
"Welcome"
System
println
out
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What is the name of the method in the given method call?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-38
What is the argument in the given method call?
System.out.println("Welcome");
out
println
"Welcome"
System
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What is the argument in the given method call?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-39
What is the output of the following Java statement?
System.out.println("4 + 6");
10
46
4
4 + 6
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What is the output of the following Java statement?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-40
What is the output of the following Java statement?
System.out.println(4 + 6);
4 + 6
4
10
46
- Section Ref
- Section 1.5 Analyzing Your First Program
- Title
- What is the output of the following Java statement?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-41
Which statement is true about the following Java
code fragment:
System.out.println("Hello!);
- There is a run-time error.
- There are no errors.
- There is a compile-time error.
- There are multiple errors.
- Title
- Which statement is true about the following Java code fragment?
- Section reference
- 1.6 Errors
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-42
Assuming the programmer wishes to display "Hello!" on the screen,
which statement is true about the following Java code fragment:
System.out.println("Helo!");
- There is a run-time error.
- There are no errors.
- There is a compile-time error.
- There are multiple errors.
- Title
- Which statement is true about the following Java code fragment?
- Section reference
- 1.6 Errors
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-43
Assuming the programmer wishes to display "Hello!" on the screen,
which statement is true about the following Java code fragment:
System.out.println("Hello!");
- There is a run-time error.
- There are no errors.
- There is a compile-time error.
- There are multiple errors.
- Title
- Which statement is true about the following Java code fragment?
- Section reference
- 1.6 Errors
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-44
Assuming the programmer wishes to display "Hello!" on the screen,
which statement is true about the following Java
code fragment:
System.out.printn("Helo!");
- There is a run-time error.
- There are no errors.
- There is a compile-time error.
- There are multiple errors.
- Title
- Which statement is true about the following Java code fragment?
- Section reference
- 1.6 Errors
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-45
Assume that the following Java statement is contained in the
main
method of the class named Hello
:
System.out.printLine("Hello!");
What is the name of the file generated by the Java compiler?
Hello.java
- Hello
- No file is generated due to an error.
Hello.class
- Title
- What is the name of the file generated by the Java compiler?
- Section reference
- 1.6 Errors
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-46
What is a logic error?
- A violation of the rules of the computer language.
- A missing
main
method.
- A program that is syntactically correct but does not do
what it is supposed to do.
- An error that is so severe that it generates an exception.
- Title
- What is a logic error?
- Section reference
- 1.6 Errors
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-47
What is the term used to describe an error detected by the compiler
that is a violation of the programming language rules?
- logic error
- compile-time error
- run-time error
- typo
- Section Ref
- Section 1.6 Errors
- Title
- Term describing an error violating the programming language rules.
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-48
Other than compile-time error, what is another term used to describe an error detected
by the compiler that is a violation of the programming language rules?
- typo
- logic error
- syntax error
- run-time error
- Section Ref
- Section 1.6 Errors
- Title
- Another term describing an error violating the programming language rules.
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-49
What is the term used to describe an error causing a program to take
an action that the programmer did not intend?
- typo
- run-time error
- compile-time error
- syntax error
- Section Ref
- Section 1.6 Errors
- Title
- Term describing an error causing a program to take an action that the programmer did not intend)
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-50
Other than run-time error, what is another term used to describe an error causing a
program to take an action that the programmer did not intend?
- syntax error
- logic error
- mistake
- compile-time error
- Section Ref
- Section 1.6 Errors
- Title
- Another term describing an error causing a program to take an action that the programmer did not intend)
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-51
Which statement is true about the following Java statement:
System.out.Println("Welcome!");
- There are multiple errors.
- There are no errors.
- There is a run-time error.
- There is a compile-time error.
- Section Ref
- Section 1.6 Errors
- Title
- Which statement is true about the following Java statement?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-52
Assuming the programmer wishes to output the phrase "Hello!", which of
the following is true about the following Java statement:
System.out.println("Welcme!");
- There are multiple errors.
- There is a run-time error.
- There are no errors.
- There is a compile-time error.
- Section Ref
- Section 1.6 Errors
- Title
- Which statement is true about the following Java statement?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-53
Assuming the programmer wishes to output the phrase "Welcome!", Which statement
is true about the following Java statement:
System.out.println("Welcome!");
- There are no errors.
- There is a run-time error.
- There are multiple errors.
- There is a compile-time error.
- Section Ref
- Section 1.6 Errors
- Title
- Which statement is true about the following Java statement?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-54
Assuming the programmer wishes to output the phrase "Welcome!", which
of the following is true about the following Java statement.
System.out.Println("Wlcome!");
- There are no errors.
- There is a compile-time error.
- There is a run-time error.
- There are multiple errors.
- Section Ref
- Section 1.6 Errors
- Title
- Which statement is true about the following Java statement?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-55
Assume that the main
method of the class named
Welcome
does not contain any compile-time errors. What is the name of
the file generated by the Java compiler?
Welcome.class
Welcome.java
- No additional file is generated.
Welcome
- Section Ref
- Section 1.6 Errors
- Title
- Assume that the main method of the class named Welcome does not contain any compile-time errors. What is the name of the file generated by the Java compiler?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-56
Which statement is true about the compilation process?
- The compiler will generate CPU specific instructions even if it
detects an error.
- The compiler will generate Java virtual machine instructions even if
it detects an error.
- The compiler will stop compiling when it finds the first error.
- The compiler will continue compiling after it finds an
error.
- Section Ref
- Section 1.6 Errors
- Title
- Which statement is true about the compilation process?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-57
Who or what is responsible for inspecting and testing the program to
guard against logic errors?
- JVM
- programmer
- end-user
- compiler
- Section Ref
- Section 1.6 Errors
- Title
- Who/what is responsible for ... guarding against logic errors?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-58
If you get a sequence of error messages from the compiler that are increasingly
off track, you should
- check for division by zero
- restructure your code to make it more readable
- check for spelling, capitalization, or missing quotation marks
- include more of your code within the
main
method
- Section Ref
- Section 1.6 Errors
- Title
- If you get a sequence of error messages from the compiler that are increasingly off track, you should
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-59
The error message "cannot find symbol" is usually a good clue that what kind
of error has been made?
- logic
- spelling
- run-time
- division by zero
- Section Ref
- Section 1.6 Errors
- Title
- The error message "cannot find symbol" is usually a good clue that what kind of error has been made?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-60
A sequence of steps that contains precise instructions for what to do at
each step and where to go next is ______________.
- unambiguous
- terminating
- executable
- documented
- Title
- A sequence of steps that contains precise instructions...?
- Section reference
- 1.7 Problem Solving: Algorithm Design
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-61
A sequence of steps that can be carried out in practice is
______________.
- unambiguous
- terminating
- executable
- documented
- Title
- A sequence of steps that can be carried out in practice ...?
- Section reference
- 1.7 Problem Solving: Algorithm Design
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-62
A sequence of steps that eventually comes to an end is ______________.
- unambiguous
- terminating
- executable
- documented
- Title
- A sequence of steps that eventually comes to an end ...?
- Section reference
- 1.7 Problem Solving: Algorithm Design
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-63
What is the purpose of the following algorithm?
input somenum
Repeat the following steps for 14 times
input variable1
if variable1 < somenum then
somenum = variable1
print somenum
- To search for a particular number among 15 numbers.
- To find the largest among 15 numbers.
- To print out the 15 numbers.
- To find the smallest among 15 numbers.
- Title
- What is the purpose of the following algorithm?
- Section reference
- 1.7 Problem Solving: Algorithm Design
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-64
Evaluate the given pseudocode to calculate the efficiency
of a vehicle's fuel consumption using the following test values, rounded to one decimal place:
The trip odometer reading (odometer) = 350
The amount to fill the gas tank (amount) = 12
input odometer
input amount
output odometer/amount
What is the final output?
- 27.7
- 29.2
- 34.4
- 32.3
- Title
- What is output of this pseudocode with these test values?
- Section reference
- 1.7 Problem Solving: Algorithm Design
- Difficulty
- Medium
- id
- testbank-bj-6-ch01-65
Evaluate the given pseudocode to calculate the weighted score for a
student:
The homework score (homework) = 95
The weight of homework (hwWeight) = 35%
The exam score (exams) = 87
The weight of exams(exWeight) = 65%
input homework
input hwWeight
input exams
input exWeight
output homework*hwWeight + exams*exWeight
What is the final output?
- 89.20
- 89.80
- 87.80
- 92.20
- Title
- What is the final output?
- Section reference
- 1.7 Problem Solving: Algorithm Design
- Difficulty
- Medium
- id
- testbank-bj-6-ch01-66
Evaluate the given pseudocode to calculate the payment (pmt) with the
following test values:
The total number of hours worked (working_hours) = 60
The rate paid for hourly work (rate) = 12
input working_hours
input rate
pmt = working_hours * rate
if working_hours > 40 then
extra_hours = working_hours - 40
extra_pmt = extra_hours * rate
pmt = pmt + extra_pmt
output pmt
What is the final output?
- 960
- 840
- 240
- 720
- Title
- What is output of this pseudocode with these test values?
- Section reference
- 1.7 Problem Solving: Algorithm Design
- Difficulty
- Hard
- id
- testbank-bj-6-ch01-67
What term is used to refer to an informal description of a sequence of
steps for solving a problem?
- assembly language instructions
- pseudocode
- machine instructions for a specific CPU
- Java virtual machine instructions
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- What term is used to refer to an informal description of a sequence of steps for solving a problem?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-68
What term is used to refer to a sequence of steps for solving a
problem that is unambiguous, executable, and terminating?
- documentation
- pseudoprogram
- algorithm
- comments
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- What term is used to refer to a sequence of steps for solving a problem that is unambiguous, executable, and terminating?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-69
Which of the following options is true about algorithms?
- Algorithms are described informally and can contain ambiguous
steps.
- Algorithms are written in a programming language.
- Algorithms can replace the source code in programs.
- You must create an algorithm for a problem before you
can create a program to solve the problem.
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- Which of the following options is true about algorithms?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-70
A sequence of steps is unambiguous when ___________________________
- it will eventually come to an end.
- it is clearly documented.
- it can be carried out in practice.
- there are precise instructions for what to do at each
step and where to go next.
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- A sequence of steps is unambiguous when ...?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-71
A sequence of steps is executable when ___________________________
- it will eventually come to an end.
- it can be carried out in practice.
- it is documented.
- there are precise instructions for what to do at each step and where
to go next.
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- A sequence of steps is executable when ...?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-72
A sequence of steps is terminating when ___________________________
- there are precise instructions for what to do at each step and where
to go next.
- it will eventually come to an end.
- it can be documented.
- it can be carried out in practice.
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- A sequence of steps is terminating when ...?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-73
What is the purpose of the following algorithm?
input num
Repeat the following steps for 9 times
input var1
if var1 > num then
num = var1
print num
- To print out the 10 numbers
- To search for a particular number among 10 numbers
- To find the largest among 10 numbers
- To find the smallest among 10 numbers
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- What is the purpose of the following algorithm?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-74
Evaluate the given pseudocode to calculate the efficiency of a
vehicle's fuel consumption using the following test values:
The trip odometer reading (odometer) = 300
The amount to fill the gas tank (amount) = 15
input odometer
input amount
output odometer/amount
What is the final output?
- 15
- 10
- 30
- 20
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- What is output of this pseudocode with these test values?
- Difficulty
- Medium
- id
- testbank-bj-6-ch01-75
Evaluate the given pseudocode to calculate the weighted score for a
student:
The program score (program) = 92
The weight of programs (pgmWeight) = 40%
The exam score (exams) = 85
The weight of exams(exWeight) = 60%
input program
input pgmWeight
input exams
input exWeight
output program*pgmWeight + exams*exWeight
What is the final output?
- 89.20
- 87.80
- 89.80
- 92.20
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- What is output of this pseudocode with these test values?
- Difficulty
- Medium
- id
- testbank-bj-6-ch01-76
Evaluate the given pseudocode to calculate the payment (pmt) with the
following test values:
The total number of hours worked (working_hours) = 50
The rate paid for hourly work (rate) = 10
input working_hours
input rate
pmt = working_hours * rate
if working_hours > 40 then
extra_hours = working_hours – 40
extra_pmt = extra_hours * rate
pmt = pmt + extra_pmt
end of if
output pmt
What is the final output?
- 540
- 580
- 500
- 600
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- What is output of this pseudocode with these test values?
- Difficulty
- Hard
- id
- testbank-bj-6-ch01-77
What is the correct order of the steps in the program development
process:
i. Develop and describe the algorithm.
ii. Translate the algorithm into Java.
iii. Understand the problem.
iv. Compile and test the program.
v. Test the algorithm with different inputs.
- iii, i, ii, iv, v
- i, ii, iv, v, iii
- iii, i, v, ii, iv
- i, iii, v, ii, iv
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- What is the order of the steps in the program development process?
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-78
Pseudocode must be
i. Unambiguous.
ii. Syntactically correct code.
iii. Readable by a human.
iv. Indicative of results of an algorithm.
- i, ii
- i, ii, iii
- i, iii, iv
- ii, iii, iv
- Section Ref
- Section 1.7 Problem Solving: Algorithm Design
- Title
- Pseudocode must be
- Difficulty
- Easy
- id
- testbank-bj-6-ch01-79