[go: up one dir, main page]

0% found this document useful (0 votes)
5 views22 pages

Test Bank For Big Java Early Objects 6th Edition

Uploaded by

7legyjryy1
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)
5 views22 pages

Test Bank For Big Java Early Objects 6th Edition

Uploaded by

7legyjryy1
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/ 22

Test Bank + Answer Key

Test Bank for Big Java Early Objects 6th Edition by Cay S.
Horstmann (Author

View Full Product:


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

Book Title: Big Java Early Objects

Edition: 6th Edition

Author: Cay S. Horstmann (Author

Click above to view a sample


file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

Book Big Java, Early Objects


Edition 6
Title Introduction

1. Which statement best describes a computer program?

A. A program is a sequence of comments.


B. A program can decide what task it is to perform.
C. A program is a sequence of instructions and decisions that the computer carries out. Answer
D. 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

2. Which statement regarding computer programs is correct?

A. Computer programs can decide what task to perform.


B. Large and complex computer programs are generally written by only one programmer.
C. Computer programs are composed of extremely primitive operations. Answer
D. 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

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

A. Add up two numbers. Answer


B. Lay out a term paper.
C. Drive a car.
D. 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

4. What does CPU stand for?

A. Computer Programming Unit


B. Computer Processing Unit
C. Central Processing Unit Answer
D. 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

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

1 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

A. Performing arithmetic operations


B. Processing data and controlling programs
C. Querying a database Answer
D. 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

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

A. compact disk (CD)


B. hard disk
C. primary storage Answer
D. 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

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

A. primary storage
B. RAM
C. memory
D. secondary storage Answer
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

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

A. primary storage
B. secondary storage Answer
C. peripheral device
D. 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

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

A. hard disk Answer


B. solid state drive
C. compact disk (CD)
D. memory
Section Ref Section 1.2 The Anatomy of a Computer

2 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

Title Which type of secondary storage consists of rotating platters coated with a magnetic
material?
Difficulty Easy
id testbank-bj-6-ch01-09

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

A. bus
B. networks Answer
C. peripheral devices
D. 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

11. Which is an example of a peripheral device?

A. the CPU
B. primary storage
C. motherboard
D. speakers Answer
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

12. Which memory type does not provide persistent storage?

A. secondary storage
B. hard disk
C. primary storage Answer
D. 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

13. Where must program instructions and data reside in order for the CPU to directly read and execute
them?

A. memory Answer
B. bus
C. hard disk
D. 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

3 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

A. virtual machine
B. machine code Answer
C. high-level code
D. 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

15. What is the Java Virtual Machine?

A. A CPU that runs compiled Java code.


B. A library that makes it possible to write portable programs.
C. A program that simulates a real CPU running compiled Java code. Answer
D. 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

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

A. applet Answer
B. script
C. html
D. 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

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

A. virtual
B. high-level Answer
C. sophisticated
D. 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

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

A. debugger
B. assembler

4 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

C. compiler Answer
D. 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

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

A. linker
B. compiler Answer
C. assembler
D. 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

20. Which statement is true about running a Java program on a different CPU?

A. You need different Java source code for each CPU.


B. You can take code that has been generated by the Java compiler and run it on different
CPUs. Answer
C. You need to compile the Java program for each CPU.
D. 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

21. When was Java officially introduced?

A. 1991
B. 1995 Answer
C. 2000
D. 2005
Section Ref Section 1.3 The Java Programming Language
Title When was Java officially introduced?
Difficulty Easy
id testbank-bj-6-ch01-21

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

A. The same already-compiled Java programs will run on Windows, UNIX, Linux, or Macintosh
operating systems without any change. Answer
B. The same Java compiler can be used on many operating systems.
C. There are only small differences between the Java programming language on different operating
systems.

5 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

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

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


B. The source code is backed up to a network storage facility.
C. A Java compiler converts all uppercase letters to lowercase.
D. A Java compiler translates the source code into class files. Answer
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

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

A. The time you spend will prevent data loss without the need for backups.
B. The tools needed for Java programming are different from other software. Answer
C. Although computer systems vary widely, the Java programming environment is always the same.
D. 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

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?

A. Defragment the hard drive.


B. Purchase an anti-virus program to remove the virus from your computer.
C. Make regular backups of all your important files. Answer
D. 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

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

A. You should have multiple copies of your source files in different locations. Answer
B. You should regularly print out your work so you can retype it in case of data loss.
C. You should regularly back up the Java virtual machine instructions to prevent loss of valuable
work.
D. Your compiler automatically makes backups of your source files.

6 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

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

A. Declaration of the variable class.


B. Declaration of the class HelloPrinter. Answer
C. Declaration of the variable public.
D. 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

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

A. class Answer
B. CPU
C. applet
D. 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

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

A. HelloPrinter
B. HelloPrinter.java Answer
C. HelloPrinter.class
D. 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

30. A __________ contains sequences of programming instructions that describe how to perform a
particular task.

A. parameter
B. label
C. variable
D. method Answer
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

7 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

A. statement Answer
B. constant
C. comment
D. 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

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

A. .
B. )
C. !
D. ; Answer

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

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

A. string Answer
B. object
C. comment
D. 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

34. What term is used to refer to values supplied to a method that are needed to carry out its task?

A. class
B. object
C. argument Answer
D. 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

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

A. () Answer
B. " "
C. {}

8 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

D. //
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

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

A. program name, method name


B. strings, method name
C. method name, arguments Answer
D. 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

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

A. println("Any message").System.out;
B. System.out("Any message").println;
C. System.out.println("Any message"); Answer
D. 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

38. What is the name of the method in the given method call?

System.out.println("Welcome");

A. "Welcome"
B. System
C. println Answer
D. 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

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

System.out.println("Welcome");

A. out
B. println
C. "Welcome" Answer
D. System
Section Ref Section 1.5 Analyzing Your First Program
Title What is the argument in the given method call?

9 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

Difficulty Easy
id testbank-bj-6-ch01-39

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


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

A. 10
B. 46
C. 4
D. 4 + 6 Answer

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

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

System.out.println(4 + 6);

A. 4 + 6
B. 4
C. 10 Answer
D. 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

42. Which statement is true about the following Java code fragment:

System.out.println("Hello!);

A. There is a run-time error.


B. There are no errors.
C. There is a compile-time error. Answer
D. 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

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!");

A. There is a run-time error. Answer


B. There are no errors.
C. There is a compile-time error.
D. There are multiple errors.
Title Which statement is true about the following Java code fragment?

10 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

Section reference 1.6 Errors


Difficulty Easy
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!");

A. There is a run-time error.


B. There are no errors. Answer
C. There is a compile-time error.
D. 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

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!");

A. There is a run-time error.


B. There are no errors.
C. There is a compile-time error.
D. There are multiple errors. Answer
Title Which statement is true about the following Java code fragment?
Section reference 1.6 Errors
Difficulty Easy
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?

A. Hello.java
B. Hello
C. No file is generated due to an error. Answer
D. 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

47. What is a logic error?

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


B. A missing main method.
C. A program that is syntactically correct but does not do what it is supposed to do. Answer

11 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

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

A. logic error
B. compile-time error Answer
C. run-time error
D. 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

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?

A. typo
B. logic error
C. syntax error Answer
D. 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

50. What is the term used to describe an error causing a program to take an action that the programmer did
not intend?

A. typo
B. run-time error Answer
C. compile-time error
D. 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

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?

A. syntax error
B. logic error Answer
C. mistake
D. compile-time error

12 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

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

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

A. There are multiple errors.


B. There are no errors.
C. There is a run-time error.
D. There is a compile-time error. Answer
Section Ref Section 1.6 Errors
Title Which statement is true about the following Java statement?
Difficulty Easy
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!");

A. There are multiple errors.


B. There is a run-time error. Answer
C. There are no errors.
D. 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

54. Assuming the programmer wishes to output the phrase "Welcome!", Which statement is true about the
following Java statement:

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

A. There are no errors. Answer


B. There is a run-time error.
C. There are multiple errors.
D. 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

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!");

A. There are no errors.

13 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

B. There is a compile-time error.


C. There is a run-time error.
D. There are multiple errors. Answer
Section Ref Section 1.6 Errors
Title Which statement is true about the following Java statement?
Difficulty Easy
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?

A. Welcome.class Answer
B. Welcome.java
C. No additional file is generated.
D. 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

57. Which statement is true about the compilation process?

A. The compiler will generate CPU specific instructions even if it detects an error.
B. The compiler will generate Java virtual machine instructions even if it detects an error.
C. The compiler will stop compiling when it finds the first error.
D. The compiler will continue compiling after it finds an error. Answer
Section Ref Section 1.6 Errors
Title Which statement is true about the compilation process?
Difficulty Easy
id testbank-bj-6-ch01-57

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

A. JVM
B. programmer Answer
C. end-user
D. 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

59. If you get a sequence of error messages from the compiler that are increasingly off track, you should

A. check for division by zero


B. restructure your code to make it more readable
C. check for spelling, capitalization, or missing quotation marks Answer
D. include more of your code within themain method
Section Ref Section 1.6 Errors

14 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

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

A. logic
B. spelling Answer
C. run-time
D. 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

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

A. unambiguous Answer
B. terminating
C. executable
D. 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

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

A. unambiguous
B. terminating
C. executable Answer
D. 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

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

A. unambiguous
B. terminating Answer
C. executable
D. 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

15 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

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


B. To find the largest among 15 numbers.
C. To print out the 15 numbers.
D. To find the smallest among 15 numbers. Answer
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

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?

A. 27.7
B. 29.2 Answer
C. 34.4
D. 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

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%

16 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

input homework
input hwWeight
input exams
input exWeight
output homework*hwWeight + exams*exWeight

What is the final output?

A. 89.20
B. 89.80 Answer
C. 87.80
D. 92.20
Title What is the final output?
Section reference 1.7 Problem Solving: Algorithm Design
Difficulty Medium
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?

A. 960 Answer
B. 840
C. 240
D. 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

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

A. assembly language instructions


B. pseudocode Answer
C. machine instructions for a specific CPU

17 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

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

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

A. documentation
B. pseudoprogram
C. algorithm Answer
D. 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

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

A. Algorithms are described informally and can contain ambiguous steps.


B. Algorithms are written in a programming language.
C. Algorithms can replace the source code in programs.
D. You must create an algorithm for a problem before you can create a program to solve the
problem. Answer
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

71. A sequence of steps is unambiguous when ___________________________

A. it will eventually come to an end.


B. it is clearly documented.
C. it can be carried out in practice.
D. there are precise instructions for what to do at each step and where to go next. Answer
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

72. A sequence of steps is executable when ___________________________

A. it will eventually come to an end.


B. it can be carried out in practice. Answer
C. it is documented.
D. 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

18 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

Title A sequence of steps is executable when ...?


Difficulty Easy
id testbank-bj-6-ch01-72

73. A sequence of steps is terminating when ___________________________

A. there are precise instructions for what to do at each step and where to go next.
B. it will eventually come to an end. Answer
C. it can be documented.
D. 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

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

A. To print out the 10 numbers


B. To search for a particular number among 10 numbers
C. To find the largest among 10 numbers Answer
D. 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

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?

A. 15
B. 10
C. 30

19 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

D. 20 Answer
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

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?

A. 89.20
B. 87.80 Answer
C. 89.80
D. 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

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

20 of 21 5/27/17, 8:21 PM
file:///C:/Users/Mhmoud/Desktop/testbank_bj_6_xhtml/bj-6-ch01.testba...

What is the final output?

A. 540
B. 580
C. 500
D. 600 Answer
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

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.

A. iii, i, ii, iv, v


B. i, ii, iv, v, iii
C. iii, i, v, ii, iv Answer
D. 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

79. Pseudocode must be

i. Unambiguous.

ii. Syntactically correct code.

iii. Readable by a human.

iv. Indicative of results of an algorithm.

A. i, ii
B. i, ii, iii
C. i, iii, iv Answer
D. ii, iii, iv
Section Ref Section 1.7 Problem Solving: Algorithm Design
Title Pseudocode must be
Difficulty Easy
id testbank-bj-6-ch01-79

21 of 21 5/27/17, 8:21 PM

You might also like