[go: up one dir, main page]

0% found this document useful (0 votes)
25 views37 pages

Test Bank For Big Java Early Objects 7th Edition

Uploaded by

anb2gob0af
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views37 pages

Test Bank For Big Java Early Objects 7th Edition

Uploaded by

anb2gob0af
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Test Bank + Answer Key

Test Bank for Big Java Early Objects 7th Edition by Cay S.
Horstmann

View Full Product:


https://selldocx.com/products/test-bank-big-java-early-objects-7e-horstmann

Book Title: Big Java Early Objects

Edition: 7th Edition

Author: Cay S. Horstmann

Click above to view a sample


1. Which statement best describes a computer program?

1. A program is a sequence of comments.


2. A program can decide what task it is to perform.
3. A program is a sequence of instructions and decisions that the computer carries
out.
4. A program can only perform one simple task.
Section Ref
Section 1.1 Computer Programs
diff
1
Title
Which statement best describes a computer program?
type
mc
section
1.1 Computer Programs
id
testbank-bj-6-ch01-1

2. Which statement regarding computer programs is correct?

1. Computer programs can decide what task to perform.


2. Large and complex computer programs are generally written by only one
programmer.
3. Computer programs are composed of extremely primitive operations.
4. Small computer programs are not documented.
diff
1
Title
Which statement regarding computer programs is correct?
type
mc
section
1.1 Computer Programs
Section reference
Section 1.1 Computer Programs
id
testbank-bj-6-ch01-2

3. What is an example of a typical instruction in a computer program?

1. Add up two numbers.


2. Lay out a term paper.
3. Drive a car.
4. Display a fancy font.
diff
1
Title
What is an example of a typical instruction in a computer program?
type
mc
section
1.1 Computer Programs
Section reference
Section 1.1 Computer Programs
id
testbank-bj-6-ch01-3

4. What does CPU stand for?

1. Computer Programming Unit


2. Computer Processing Unit
3. Central Processing Unit
4. Central Programming Unit
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
What does CPU stand for?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-4

5. Which one of the following is NOT a function of a CPU?

1. Performing arithmetic operations


2. Processing data and controlling programs
3. Querying a database
4. Fetching and storing data from storage and input devices
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which one of the following is NOT a function of a CPU?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-5

6. Which type of storage is made from electronic circuits that can store data?

1. compact disk (CD)


2. hard disk
3. primary storage
4. secondary storage
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which type of storage is made from electronic circuits that can store data?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-6

7. Which one of the following memory types provides storage that persists without
electricity?

1. primary storage
2. RAM
3. memory
4. secondary storage
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which one of the following memory types provides storage that persists without
electricity?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-7

8. Which one of the following memory types provides storage that is slower and less
expensive?

1. primary storage
2. secondary storage
3. peripheral device
4. the transistor
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which one of the following memory types provides storage that is slower and less
expensive?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-8

9. Which type of secondary storage consists of rotating platters coated with a magnetic
material?

1. hard disk
2. solid state drive
3. compact disk (CD)
4. memory
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which type of secondary storage consists of rotating platters coated with a
magnetic material?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-9

10. Some computers are self-contained units; others are interconnected through what?

1. bus
2. networks
3. peripheral devices
4. power lines
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Some computers are self-contained units; others are interconnected through what?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-10

11. Which is an example of a peripheral device?

1. the CPU
2. primary storage
3. motherboard
4. speakers
Section Ref
Section 1.2 The Anatomy of a Computer
diff
1
Title
Which is an example of a peripheral device?
type
mc
section
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-11

12. Which memory type does not provide persistent storage?

1. secondary storage
2. hard disk
3. primary storage
4. DVD
diff
1
Title
Which memory type does not provide persistent storage?
type
mc
section
1.2 The Anatomy of a Computer
Section reference
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-12
13. Where must program instructions and data reside in order for the CPU to directly read
and execute them?

1. memory
2. bus
3. hard disk
4. somewhere on the computer network
diff
1
Title
Where must program instructions and data reside in order for the CPU to read and
execute them?
type
mc
section
1.2 The Anatomy of a Computer
Section reference
1.2 The Anatomy of a Computer
id
testbank-bj-6-ch01-13

14. What term is used to refer to the computer instructions that are executed by a CPU?

1. virtual machine
2. machine code
3. high-level code
4. instruction set
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What term is used to refer to the computer instructions that are executed by a CPU?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-14

15. What is the Java Virtual Machine?

1. A CPU that runs compiled Java code.


2. A library that makes it possible to write portable programs.
3. A program that simulates a real CPU running compiled Java code.
4. A program that translates Java code into machine instructions.
diff
1
Title
What is the JVM?
type
mc
section
1.3 The Java Programming Language
Section reference
1.3 The Java Programming Language
id
testbank-bj-6-ch01-15

16. What is the term used to refer to Java code that runs in a browser?

1. applet
2. script
3. html
4. class
diff
1
Title
What is the term used to refer to Java code that runs in a browser?
type
mc
section
1.3 The Java Programming Language
Section reference
1.3 The Java Programming Language
id
testbank-bj-6-ch01-16

17. What term is used to refer to languages that allow programmers to describe tasks at a
higher conceptual level than machine code?

1. virtual
2. high-level
3. sophisticated
4. conceptual
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What term is used to refer to languages that allow programmers to describe tasks at
a higher conceptual level than machine code?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-17

18. What tool translates high-level instructions into low level machine code?

1. debugger
2. assembler
3. compiler
4. linker
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What tool translates high-level instructions into low level machine code?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-18

19. What tool translates Java source code into files that contain instructions for the Java
Virtual Machine?

1. linker
2. compiler
3. assembler
4. interpreter
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
What tool translates Java source code into files that contain instructions for the
Java Virtual Machine?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-19

20. Which statement is true about running a Java program on a different CPU?
1. You need different Java source code for each CPU.
2. You can take code that has been generated by the Java compiler and run it on
different CPUs.
3. You need to compile the Java program for each CPU.
4. 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
diff
2
Title
Which statement is true about running a Java program on a different CPU?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-20

21. When was Java officially introduced?

1. 1991
2. 1995
3. 2000
4. 2005
Section Ref
Section 1.3 The Java Programming Language
diff
1
Title
When was Java officially introduced?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-21

22. Which statement best describes the portability characteristic of Java?

1. The same already-compiled Java programs will run on Windows, UNIX, Linux,
or Macintosh operating systems without any change.
2. The same Java compiler can be used on many operating systems.
3. There are only small differences between the Java programming language on
different operating systems.
4. 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
diff
1
Title
Which statement best describes the portability characteristic of Java?
type
mc
section
1.3 The Java Programming Language
id
testbank-bj-6-ch01-22

23. No matter which Java development environment you use, what happens to the Java
source code in order for a Java program to execute?

1. The source code is automatically separated into many files.


2. The source code is backed up to a network storage facility.
3. A Java compiler converts all uppercase letters to lowercase.
4. A Java compiler translates the source code into class files.
diff
1
Title
 No matter which Java development environment you use, what happens to the
Java source code in order for a Java program to execute?
type
mc
section
1.4 Becoming Familiar with Your Programming Environment
Section reference
1.4 Becoming Familiar With Your Programming Environment
id
testbank-bj-6-ch01-23

24. Why should you set aside time to become familiar with the programming environment?

1. The time you spend will prevent data loss without the need for backups.
2. The tools needed for Java programming are different from other software.
3. Although computer systems vary widely, the Java programming environment is
always the same.
4. The Java libraries are detailed and extensive.
diff
1
Title
Why should you set aside time to become familiar with the programming
environment?
type
mc
section
1.4 Becoming Familiar with Your Programming Environment
Section reference
1.4 Becoming Familiar With Your Programming Environment
id
testbank-bj-6-ch01-24

25. 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?

1. Defragment the hard drive.


2. Purchase an anti-virus program to remove the virus from your computer.
3. Make regular backups of all your important files.
4. Purchase an extended warranty for your computer.
Section Ref
1.4 Becoming Familiar With Your Programming Environment
diff
1
Title
What can prevent you from losing files that get corrupted?
type
mc
section
1.4 Becoming Familiar with Your Programming Environment
id
testbank-bj-6-ch01-25

26. Which statement regarding backup strategies for Java files is correct?

1. You should have multiple copies of your source files in different locations.
2. You should regularly print out your work so you can retype it in case of data loss.
3. You should regularly back up the Java virtual machine instructions to prevent loss
of valuable work.
4. Your compiler automatically makes backups of your source files.
diff
1
Title
Which one of the following statements regarding backup strategies for Java files is
correct?
type
mc
section
1.4 Becoming Familiar with Your Programming Environment
Section reference
1.4 Becoming Familiar With Your Programming Environment
id
testbank-bj-6-ch01-26

27. The line public class HelloPrinter indicates which declaration below?

1. Declaration of the variable class.


2. Declaration of the class HelloPrinter.
3. Declaration of the variable public.
4. Declaration of the class public.
diff
1
Title
The line public class HelloPrinter indicates which declaration below?
type
mc
section
1.5 Analyzing Your First Program
Section reference
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-27

28. Every Java program consists of one or more of these fundamental building blocks.

1. class
2. CPU
3. applet
4. parameter
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
TB Every Java program consists of one or more of these fundamental building
blocks.
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-28

29. What is the name of the file that contains the Java source code for the public class
HelloPrinter?

1. HelloPrinter
2. HelloPrinter.java
3. HelloPrinter.class
4. HelloPrinter.txt
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the name of the file that contains the Java source code for this class?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-29

30. A __________ contains sequences of programming instructions that describe how to


perform a particular task.

1. parameter
2. label
3. variable
4. method
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
A __________ contains sequences of programming instructions that describe how
to perform a particular task.
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-30

31. What term is used to refer to an individual instruction inside a method?

1. statement
2. constant
3. comment
4. object
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What term is used to refer to an individual instruction inside a method?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-31

32. In Java, every statement must end with which symbol?

1. .
2. )
3. !
4. ;
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
In Java, every statement must end with this symbol.
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-32

33. What term is used to refer to a sequence of characters enclosed in quotation marks?

1. string
2. object
3. comment
4. variable
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What term is used to refer to a sequence of characters enclosed in quotation marks?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-33
34. What term is used to refer to values supplied to a method that are needed to carry out its
task?

1. class
2. object
3. argument
4. comment
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What term is used to refer to values supplied to a method that are needed to carry
out its task?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-34

35. Arguments supplied to methods are enclosed by which symbols?

1. ()
2. " "
3. {}
4. //
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
Arguments supplied to methods are enclosed by which symbols?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-35

36. Whenever a method is called in Java, what must be specified?

1. program name, method name


2. strings, method name
3. method name, arguments
4. the main method, arguments
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
Whenever a method is called in Java, what must be specified?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-36

37. What is the syntax for calling the println method on the object System.out?

1. println("Any message").System.out;
2. System.out("Any message").println;
3. System.out.println("Any message");
4. println(System.out,"Any message");
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the syntax for calling the println method on the object System.out?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-37

38. What is the name of the method in the given method call?
System.out.println("Welcome");

1. "Welcome"
2. System
3. println
4. out
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the name of the method in the given method call?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-38

39. What is the argument in the given method call?


System.out.println("Welcome");

1. out
2. println
3. "Welcome"
4. System
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the argument in the given method call?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-39

40. What is the output of the following Java statement?


System.out.println("4 + 6");

1. 10
2. 46
3. 4
4. 4 + 6
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the output of the following Java statement?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-40

41. What is the output of the following Java statement?


System.out.println(4 + 6);

1. 4 + 6
2. 4
3. 10
4. 46
Section Ref
Section 1.5 Analyzing Your First Program
diff
1
Title
What is the output of the following Java statement?
type
mc
section
1.5 Analyzing Your First Program
id
testbank-bj-6-ch01-41

42. Which statement is true about the following Java code fragment:
System.out.println("Hello!);

1. There is a run-time error.


2. There are no errors.
3. There is a compile-time error.
4. There are multiple errors.
diff
1
Title
Which statement is true about the following Java code fragment?
type
mc
section
1.6 Errors
Section reference
1.6 Errors
id
testbank-bj-6-ch01-42

43. Assuming the programmer wishes to display "Hello!" on the screen, which statement is
true about the following Java code fragment:
System.out.println("Helo!");

1. There is a run-time error.


2. There are no errors.
3. There is a compile-time error.
4. There are multiple errors.
diff
1
Title
Which statement is true about the following Java code fragment?
type
mc
section
1.6 Errors
Section reference
1.6 Errors
id
testbank-bj-6-ch01-43

44. Assuming the programmer wishes to display "Hello!" on the screen, which statement is
true about the following Java code fragment:
System.out.println("Hello!");

1. There is a run-time error.


2. There are no errors.
3. There is a compile-time error.
4. There are multiple errors.
diff
1
Title
Which statement is true about the following Java code fragment?
type
mc
section
1.6 Errors
Section reference
1.6 Errors
id
testbank-bj-6-ch01-44

45. Assuming the programmer wishes to display "Hello!" on the screen, which statement is
true about the following Java code fragment:
System.out.printn("Helo!");

1. There is a run-time error.


2. There are no errors.
3. There is a compile-time error.
4. There are multiple errors.
diff
1
Title
Which statement is true about the following Java code fragment?
type
mc
section
1.6 Errors
Section reference
1.6 Errors
id
testbank-bj-6-ch01-45

46. 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?

1. Hello.java
2. Hello
3. No file is generated due to an error.
4. Hello.class
diff
1
Title
What is the name of the file generated by the Java compiler?
type
mc
section
1.6 Errors
Section reference
1.6 Errors
id
testbank-bj-6-ch01-46

47. What is a logic error?

1. A violation of the rules of the computer language.


2. A missing main method.
3. A program that is syntactically correct but does not do what it is supposed to do.
4. An error that is so severe that it generates an exception.
diff
1
Title
What is a logic error?
type
mc
section
1.6 Errors
Section reference
1.6 Errors
id
testbank-bj-6-ch01-47

48. What is the term used to describe an error detected by the compiler that is a violation of
the programming language rules?

1. logic error
2. compile-time error
3. run-time error
4. typo
Section Ref
Section 1.6 Errors
diff
1
Title
Term describing an error violating the programming language rules.
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-48

49. 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?

1. typo
2. logic error
3. syntax error
4. run-time error
Section Ref
Section 1.6 Errors
diff
1
Title
Another term describing an error violating the programming language rules.
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-49
50. What is the term used to describe an error causing a program to take an action that the
programmer did not intend?

1. typo
2. run-time error
3. compile-time error
4. syntax error
Section Ref
Section 1.6 Errors
diff
1
Title
Term describing an error causing a program to take an action that the programmer
did not intend)
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-50

51. 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?

1. syntax error
2. logic error
3. mistake
4. compile-time error
Section Ref
Section 1.6 Errors
diff
1
Title
Another term describing an error causing a program to take an action that the
programmer did not intend)
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-51

52. Which statement is true about the following Java statement:


System.out.Println("Welcome!");

1. There are multiple errors.


2. There are no errors.
3. There is a run-time error.
4. There is a compile-time error.
Section Ref
Section 1.6 Errors
diff
1
Title
Which statement is true about the following Java statement?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-52

53. Assuming the programmer wishes to output the phrase "Hello!", which of the following
is true about the following Java statement:
System.out.println("Welcme!");

1. There are multiple errors.


2. There is a run-time error.
3. There are no errors.
4. There is a compile-time error.
Section Ref
Section 1.6 Errors
diff
1
Title
Which statement is true about the following Java statement?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-53

54. Assuming the programmer wishes to output the phrase "Welcome!", Which statement is
true about the following Java statement:
System.out.println("Welcome!");

1. There are no errors.


2. There is a run-time error.
3. There are multiple errors.
4. There is a compile-time error.
Section Ref
Section 1.6 Errors
diff
1
Title
Which statement is true about the following Java statement?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-54

55. Assuming the programmer wishes to output the phrase "Welcome!", which of the
following is true about the following Java statement.
System.out.Println("Wlcome!");

1. There are no errors.


2. There is a compile-time error.
3. There is a run-time error.
4. There are multiple errors.
Section Ref
Section 1.6 Errors
diff
1
Title
Which statement is true about the following Java statement?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-55

56. 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?

1. Welcome.class
2. Welcome.java
3. No additional file is generated.
4. Welcome
Section Ref
Section 1.6 Errors
diff
1
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?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-56

57. Which statement is true about the compilation process?

1. The compiler will generate CPU specific instructions even if it detects an error.
2. The compiler will generate Java virtual machine instructions even if it detects an
error.
3. The compiler will stop compiling when it finds the first error.
4. The compiler will continue compiling after it finds an error.
Section Ref
Section 1.6 Errors
diff
1
Title
Which statement is true about the compilation process?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-57

58. Who or what is responsible for inspecting and testing the program to guard against logic
errors?

1. JVM
2. programmer
3. end-user
4. compiler
Section Ref
Section 1.6 Errors
diff
1
Title
Who/what is responsible for ... guarding against logic errors?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-58
59. If you get a sequence of error messages from the compiler that are increasingly off track,
you should

1. check for division by zero


2. restructure your code to make it more readable
3. check for spelling, capitalization, or missing quotation marks
4. include more of your code within themain method
Section Ref
Section 1.6 Errors
diff
1
Title
If you get a sequence of error messages from the compiler that are increasingly off
track, you should
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-59

60. The error message "cannot find symbol" is usually a good clue that what kind of error has
been made?

1. logic
2. spelling
3. run-time
4. division by zero
Section Ref
Section 1.6 Errors
diff
1
Title
The error message "cannot find symbol" is usually a good clue that what kind of
error has been made?
type
mc
section
1.6 Errors
id
testbank-bj-6-ch01-60

61. A sequence of steps that contains precise instructions for what to do at each step and
where to go next is ______________.

1. unambiguous
2. terminating
3. executable
4. documented
diff
1
Title
A sequence of steps that contains precise instructions...?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-61

62. A sequence of steps that can be carried out in practice is ______________.

1. unambiguous
2. terminating
3. executable
4. documented
diff
1
Title
A sequence of steps that can be carried out in practice ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-62

63. A sequence of steps that eventually comes to an end is ______________.

1. unambiguous
2. terminating
3. executable
4. documented
diff
1
Title
A sequence of steps that eventually comes to an end ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-63

64. 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

1. To search for a particular number among 15 numbers.


2. To find the largest among 15 numbers.
3. To print out the 15 numbers.
4. To find the smallest among 15 numbers.
diff
1
Title
What is the purpose of the following algorithm?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-64

65. 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?

1. 27.7
2. 29.2
3. 34.4
4. 32.3
diff
2
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-65

66. 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?

1. 89.20
2. 89.80
3. 87.80
4. 92.20
diff
2
Title
What is the final output?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-66
67. 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?

1. 960
2. 840
3. 240
4. 720
diff
3
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
Section reference
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-67

68. What term is used to refer to an informal description of a sequence of steps for solving a
problem?

1. assembly language instructions


2. pseudocode
3. machine instructions for a specific CPU
4. Java virtual machine instructions
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
What term is used to refer to an informal description of a sequence of steps for
solving a problem?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-68

69. What term is used to refer to a sequence of steps for solving a problem that is
unambiguous, executable, and terminating?

1. documentation
2. pseudoprogram
3. algorithm
4. comments
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
What term is used to refer to a sequence of steps for solving a problem that is
unambiguous, executable, and terminating?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-69

70. Which of the following options is true about algorithms?

1.
Algorithms are described informally and can contain ambiguous steps.
2.
Algorithms are written in a programming language.
3.
Algorithms can replace the source code in programs.
4.
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
diff
1
Title
Which of the following options is true about algorithms?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-70
71. A sequence of steps is unambiguous when ___________________________

1. it will eventually come to an end.


2. it is clearly documented.
3. it can be carried out in practice.
4. 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
diff
1
Title
A sequence of steps is unambiguous when ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-71

72. A sequence of steps is executable when ___________________________

1. it will eventually come to an end.


2. it can be carried out in practice.
3. it is documented.
4. 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
diff
1
Title
A sequence of steps is executable when ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-72

73. A sequence of steps is terminating when ___________________________

1. there are precise instructions for what to do at each step and where to go next.
2. it will eventually come to an end.
3. it can be documented.
4. it can be carried out in practice.
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
A sequence of steps is terminating when ...?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-73

74. 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

1. To print out the 10 numbers


2. To search for a particular number among 10 numbers
3. To find the largest among 10 numbers
4. To find the smallest among 10 numbers
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
What is the purpose of the following algorithm?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-74

75. 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?


1. 15
2. 10
3. 30
4. 20
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
2
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-75

76. 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?

1. 89.20
2. 87.80
3. 89.80
4. 92.20
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
2
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-76

77. 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?

1. 540
2. 580
3. 500
4. 600
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
3
Title
What is output of this pseudocode with these test values?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-77

78. 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.

1. iii, i, ii, iv, v


2. i, ii, iv, v, iii
3. iii, i, v, ii, iv
4. i, iii, v, ii, iv
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
What is the order of the steps in the program development process?
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-78

79. Pseudocode must be

i. Unambiguous.

ii. Syntactically correct code.

iii. Readable by a human.

iv. Indicative of results of an algorithm.

1. i, ii
2. i, ii, iii
3. i, iii, iv
4. ii, iii, iv
Section Ref
Section 1.7 Problem Solving: Algorithm Design
diff
1
Title
Pseudocode must be
type
mc
section
1.7 Problem Solving: Algorithm Design
id
testbank-bj-6-ch01-79

You might also like