Deck 1: Introduction

Full screen (f)
exit full mode
Question
Which of the following refers to a collection of programs that a computer executes?

A) Software
B) Assembler
C) Instructions
D) Source code
Use Space or
up arrow
down arrow
to flip the card.
Question
Computer scientists have devised something that allows programmers to describe tasks in words that are closer to the syntax of the problems being solved. This is called a(n)

A) Embedded system
B) Machine instruction
C) High-level programming language
D) Compiler
Question
High-level programming languages

A) Are made up primarily of ones and zeros
B) Are independent of the underlying hardware
C) Are not standardized
D) Use syntax that is close to the underlying hardware's instruction set
Question
Which one of the following translates high-level descriptions into machine code?

A) Assembler
B) Linker
C) Compiler
D) Editor
Question
An integrated development environment (IDE) bundles tools for programming into a unified application. What kinds of tools are usually included?

A) An editor and a compiler
B) A web browser
C) Presentation tools
D) Source files and class files
Question
Programs that are not running are usually stored

A) in the CPU's memory.
B) on the computer monitor.
C) in secondary storage.
D) on a backup device that is in a different physical location from the computer.
Question
An example of an input device that interfaces between computers and humans is

A) a microphone
B) a monitor
C) a printer
D) a speaker
Question
Consider the following statements regarding computers:
I) Computers can execute a large number of instructions in a fraction of a second.
II) Computer application areas mainly target the research and scientific communities.
III) The physical components of a computer constitute its hardware.
IV) Unlike humans, a computer never gets bored or exhausted when performing repetitive tasks.
Which one of the following options is correct?

A) Only III is a valid statement.
B) I and III only are valid statements.
C) I, II, and III only are valid statements.
D) I, III, and IV only are valid statements.
Question
A single silicon chip made from potentially millions of transistors is called

A) a Central Processing Unit (CPU).
B) secondary Storage.
C) a Hard Disk.
D) an Optical Disk (such as a DVD).
Question
What is one of the benefits of using a high-level programming language like Java?

A) Its syntax is very similar to the hardware instruction set
B) No tools other than a text editor are required for programming
C) Statements in the high-level language are just like English
D) Problems solved in a high-level language are independent of the underlying computer hardware
Question
Consider the following statements about computer programs:
I) Computer programs can be written by someone who has a basic knowledge of operating a computer.
II) Computer programs can complete complex tasks quickly.
III) Large and complex computer programs are generally written by a group of programmers.
IV) Computer programs are composed of extremely primitive operations.
Which one of the following options is correct?

A) II and III only are correct statements.
B) I, II, III and IV are correct statements.
C) II, III, and IV only are correct statements.
D) I and IV only are correct statements.
Question
Which one of the following typically provides data persistence without electricity?
I) The CPU's memory
II) The hard disk
III) Secondary storage

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Question
The Central Processing Unit is primarily responsible for

A) performing program control and data processing.
B) ensuring data persists when electrical power is turned off.
C) enabling a human user to interact with the computer.
D) interconnecting computers that are separated by distance.
Question
Computer programming is

A) the speed with which a computer operates.
B) the collection of peripheral devices connected to a computer.
C) the storage of data in the form of words and pictures.
D) the act of designing and implementing a computer program.
Question
Consider a scenario in which you develop a Java program on a computer that has a Pentium processor. What step should you take to run the same Java program on a computer that has a different processor?

A) The compiled Java machine language instructions can be run on any processor that has a Java Virtual Machine.
B) Develop the same program again on the computer that has a different processor and recompile the program.
C) Recompile the program on the computer that has a different processor.
D) You cannot run the program on a computer with a different processor because high-level programming languages are machine dependent.
Question
When a program begins to run,

A) It is moved from DVD to hard disk.
B) It is moved to the CPU's memory.
C) It is moved from the CPU's memory to hard disk.
D) It must be connected to a computer network.
Question
Because Java was designed for the Internet, which two of its attributes make it suitable for beginning programmers?

A) Efficiency and portability
B) Safety and security
C) Safety and portability
D) Efficiency and security
Question
An example of an output device that interfaces between computers and humans is

A) a keyboard.
B) a mouse.
C) a speaker.
D) a microphone.
Question
Computers are machines that

A) design computer programs.
B) execute programs.
C) carry out a very narrow range of tasks.
D) are imprecise and slow.
Question
Small applications written in the Java programming language that can be located anywhere on the Internet are called

A) Applets
B) Compilers
C) Embedded systems
D) Virtual machines
Question
What kind of error is it when your program has a syntax error?

A) Compile-time error
B) Logic error
C) Run-time error
D) Exception
Question
Suppose you examine a simple Java program and the first line is public Class HelloPrinter. Is this the same thing in Java as the line public Class helloprinter?

A) No, because Java is case-sensitive, these are considered to be completely distinct
B) No, because "helloprinter" is misspelled, the Java compiler will reject it
C) Yes, because these Java symbols both have the same letters, they are considered to be the same
D) Yes, because all Java symbols must have exactly twelve characters.
Question
What is the difference between an editor and a compiler?

A) An editor converts program files into an executable program; a compiler allows program files to be written and stored
B) An editor allows program files to be written and stored; a compiler produces an organized list of files
C) An editor allows program files to be written and stored; a compiler produces an indexed database of terms and keywords
D) An editor allows program files to be written and stored; a compiler converts program files into an executable program
Question
Which of the following statements is true with respect to the main method in Java?

A) The opening and closing parentheses after the method name main are optional.
B) A semicolon is required after the statement public static void main()
C) A semicolon is required after the closing curly braces in the main method.
D) Every Java application must have a main method.
Question
These two lines of code do not produce the same output. Why?
System.out.println(7 + 3);
System.out.println("7 + 3");

A) Arithmetic calculations cannot take place within the println method call.
B) In fact, the two statements do produce the same output.
C) The quotes cause the second expression to be treated as a string.
D) Because there are no escape characters.
Question
What statements about the integrated development environment (IDE) are true?
I) You may run Java class files even after exiting the IDE.
II) The IDE can invoke a virtual machine, which is required to run a Java program.
III) Translating Java source code into class files is enough to then actually run the program.

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Question
Consider the following statements about folders and your integrated development environment (IDE):
I) Hierarchical folders help to organize a project.
II) Folders are a way to visualize the layout of a file system.
III) Folders make it impossible to lose or accidentally delete a file.

A) Only I is correct
B) I, II, and III are correct
C) Only I and II are correct
D) Only III is correct
Question
Which of the following statements regarding backup strategies for Java files are true?
I) You should back up your projects often to prevent loss of valuable work.
II) You should check your backups only in case of loss of data.
III) You should pay attention to the backup direction.

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Question
Which Java statement prints a blank line?

A) public static void main(String[] args)
B) System.out.print();
C) System.out.println();
D) System.out.Println();
Question
Characters that are grouped together between double quotes (quotation marks) in Java are called

A) reserved words
B) syntax
C) symbols
D) strings
Question
Which Java statement does not contain an error?

A) System.out.print(;
B) System.out.print()
C) System.out.printl();
D) System.out.println();
Question
Which of the following are reasons why Java is good, but not perfect, for beginners?
I) A certain amount of technical machinery is necessary to write basic, simple programs
II) There are many extensions
III) There are a large number of extensive libraries in Java

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Question
What is the output from this code snippet?
System.out.print("The sum is ");
System.out.println("7 + 3");

A) The sum is 10
B) The sum is 21
C) The sum is 4
D) The sum is 7 + 3
Question
Which of the following symbols is used to terminate a Java program statement?

A) Colon
B) Semicolon
C) Single quote
D) Period
Question
Which statement starts the declaration of a class in Java?

A) public static void main(String[] args)
B) public class Classname
C) System.out.println("Hello, World!");
D) Java class
Question
What is the output of the following code snippet?
System.out.print(4 + 4);
System.out.print(12);

A) 4 + 412
B) 4412
C) 812
D) 20
Question
Which of the following statements is valid with respect to the usage of a semicolon in Java?

A) A semicolon is used to denote the end of a statement.
B) A semicolon is used to terminate the public class statement.
C) You cannot use a semicolon to terminate the System.out.print statement.
D) You cannot put a semicolon within double quotation marks.
Question
A Java class with the name Printer has to be saved using the source file name:

A) printer.java
B) Printer.java
C) Printer.txt
D) printer.java
Question
Every statement in Java must be terminated with
)

A) the semi-colon character ;.
B) a carriage return.
C) System.out.println().
D) an escape sequence.
Question
Every Java program consists of one or more

A) Values (arguments)
B) Classes
C) Strings
D) System.out.println statements
Question
What is the purpose of the following algorithm?
SomeNum = 0
Repeat the following steps 50 times
Input variable1
If variable1 > someNum
SomeNum = variable1
Print someNum

A) To find the largest of 50 numbers
B) To print out the 50 numbers
C) To find the smallest of 50 numbers
D) To search for a particular number among 50 numbers
Question
Imagine you are planning to purchase a new cable TV dish. You are considering two cable TV dishes that have different purchase prices. Each channel service provider charges a different rate for each month that the cable TV dish is used. To determine which cable TV dish is the better buy, you need to develop an algorithm to calculate the total cost of purchasing and using each cable TV dish. What are all of the inputs that you need for this algorithm?

A) The cost of each cable TV dish and the rate for each month for using each cable TV dish
B) The cost of each cable TV dish and the number of months provided with each cable TV dish
C) The cost of each cable TV dish, the rate per month for using each cable TV dish, and the number of months provided with each cable TV dish
D) The cost of each cable TV dish, the rate per month for using each cable TV dish, and the number of months you would use the cable TV dish
Question
Consider a situation where you are buying videos online. The video seller charges $21.50 as the price per video and $6.75 as the handling cost for up to three videos. For every video purchased in addition to three videos, there is a handling charge of $1.50. In addition, there is a 9 percent tax on the cost of the videos but not on the handlingCharges. Assuming that numVideos represents the number of videos you are purchasing, which of the following is the correct algorithm for calculating the total cost of your purchase?

A) Total charge for videos = 21.50 * numVideos
Tax on the videos = numVideos * .9
If (numVideos <= 3) then handlingCharges = 6.75
Else handlingCharges = 1.50 * numVideos
Total cost of order = total charge for videos + tax + handlingCharges
B) Total charge for videos = 21.50 * numVideos
Tax on the videos = total charge for videos * .9
If (numVideos = 3) then handlingCharges = 6.75
Else handlingCharges = 1.50 * numVideos
Total cost of order = total charge for videos + tax + handlingCharges
C) Total charge for videos = 21.50 * numVideos
Tax on the videos = numVideos * .09
If (numVideos < 3) then handlingCharges = 6.75
Else handlingCharges = 6.75 + 1.50 * (numVideos - 3)
Total cost of order = total charge for videos + tax + handlingCharges
D) Total charge for videos = 21.50 * numVideos
Tax on the videos = total charge for videos * .09
If (numVideos <= 3) then handlingCharges = 6.75
Else handlingCharges = 6.75 + 1.50 * (numVideos - 3)
Total cost of order = total charge for videos + tax + handlingCharges
Question
Imagine you are planning to buy a new cell phone. You are considering two cell phones. These cell phones have different purchase prices. Each mobile service provider charges a different rate for each minute that the cell phone is used. To determine which cell phone is the better buy, you need to develop an algorithm to calculate the total cost of purchasing and using each cell phone. What are all the inputs needed for this algorithm?

A) The cost of each cell phone and the rate for each minute for each cell phone
B) The cost of each cell phone and the number of minutes provided with each cell phone
C) The cost of each cell phone, the rate per minute for each cell phone, and the number of minutes provided with each cell phone
D) The cost of each cell phone, the rate per minute for each cell phone, and the number of minutes you would use the cell phone
Question
Consider a situation where you are buying books online. The bookseller charges $19.95 as the price per book and $4.95 as the handling cost for up to three books. For every book purchased in addition to three books, there is a handling charge of $1.50. In addition, there is a 7 percent tax on the cost of the books but not on the handlingCharges. Assuming that numBooks represents the number of books you are purchasing, which of the following is the correct algorithm for calculating the total cost of your purchase?

A) Total charge for books = 19.95 * numBooks
Tax on the books = numBooks * .7
If (books <= 3) then handlingCharges = 4.95
Else handlingCharges = 1.50 * numBooks
Total cost of order = total charge for books + tax + handlingCharges
B) Total charge for books = 19.95 * numBooks
Tax on the books = total charge for books * .07
If (books = 3) then handlingCharges = 4.95
Else handlingCharges = 1.50 * numBooks
Total cost of order = total charge for books + tax + handlingCharges
C) Total charge for books = 19.95 * numBooks
Tax on the books = numBooks * .07
If (books < 3) then handlingCharges = 4.95
Else handlingCharges = 4.95 + 1.50 * (numBooks - 3)
Total cost of order = total charge for books + tax + handlingCharges
D) Total charge for books = 19.95 * numBooks
Tax on the books = total charge for books * .07
If (books <= 3) then handlingCharges = 4.95
Else handlingCharges = 4.95 + 1.50 * (numBooks - 3)
Total cost of order = total charge for books + tax + handlingCharges
Question
What is the purpose of the following algorithm, written in pseudocode?
Num = 0
Repeat the following steps 10 times
Input var1
If var1 > num
Num = var1
Print num

A) To find the highest among 10 numbers
B) To print out the 10 numbers
C) To find the smallest among 10 numbers
D) To search for a particular number among 10 numbers
Question
While developing a program, the programmer adds the discount amount to the total due instead of subtracting it. What type of an error is this?

A) A syntax error
B) A logic error
C) A hardware error
D) A compile-time error
Question
UML Supermarket has different ways of awarding discounts to its customers for each purchase they make. A 10 percent discount is given on the total value of the purchase. In addition, a standard loyalty discount is given if customers have a permanent customer card. Your program should indicate the amount payable by the customer after the discounts. Identify the inputs that the program requires from these options:
I) The discount percentage
II) The total value of the purchase
III) The loyalty-discount amount
IV) The customer card number
V) The amount payable after discount

A) I, II, and III
B) I and III
C) II, IV, and V
D) II and IV
Question
Which one of the following errors represents a part of a program that is incorrect according to the rules of the programming language?

A) Syntax errors
B) Run-time errors
C) Logic errors
D) Out-of-memory errors
Question
When a compiler finds a syntax error in a program, what happens?

A) The compiler goes ahead and produces a Java class file, but leaves out the statement where there was an error.
B) The compiler stops immediately.
C) The compiler requests input from the user before it will continue.
D) The compiler continues and may report about other errors but does not produce a Java class file.
Question
Evaluate the pseudocode below to calculate the payment (pmt) with the following test values:
The total number of hours worked (workingHours) = 50
The rate paid for hourly work (rate) = 10
Input workingHours.
Input rate.
Pmt = workingHours * rate
If working_hours > 45
ExtraHours = workingHours - 45
ExtraPmt = extraHours * rate * 2
Pmt = pmt + extraPmt
Output pmt

A) 400
B) 500
C) 600
D) 1,000
Question
You have been asked to develop an algorithm to calculate the total cost of a purchase order that contains several T shirts. The cost of each T shirt and the tax rate is known. The standard shipping charge for the entire order is $5.75, and the special delivery charge is $23.65. In addition, there is no tax on the shipping cost. Which of the following is the correct pseudocode for the required algorithm?

A) For each T shirt on the purchase order:
Order cost = order cost + T shirt cost
Total purchase order cost = order cost + tax rate + 5.75
B) For each T shirt on the purchase order:
Order cost = order cost + T shirt cost
If standard shipping
Shipping cost = 5.75
Else
Shipping cost = 23.65
Total purchase order cost = order cost * tax rate + shipping cost
C) If standard shipping
Shipping cost = 5.75
Else
Shipping cost = 23.65
For each T shirt on the purchase order:
Order cost = order cost + T shirt cost + shipping cost
Total purchase order cost = order cost * tax rate
D) If special delivery
Shipping cost = 5.75
Else
Shipping cost = 23.65
For each T shirt on the purchase order:
Order cost = order cost + T shirt cost
Total purchase order cost = order cost * tax rate + shipping cost
Question
Which one of the following methodologies is a sequence of steps formulated in English for solving a problem?

A) Flowcharts
B) Pseudocode
C) Algorithms
D) Terminations
Question
How do programmers find exceptions and run-time errors?

A) Using the compiler
B) Testing by running the program with a variety of input values
C) Carefully reading over the program code
D) Re-compiling using different symbols
Question
What is a logic error?

A) An error that occurs when a program is running because, for example, the wrong operator was used.
B) An error in a statement that does not conform to the syntax of the programming language.
C) An error in the hardware from overheating.
D) An error introduced by the compiler when it guesses at how to fix a syntax error.
Question
The programmer, not the compiler, is responsible for testing a program to identify

A) Syntax errors
B) Compile-time errors
C) Run-time errors
D) Undefined symbols
Question
What kind of error is created by the following code snippet?
System.out.print("The sum of 8 and 12 is ");
System.out.println(8 * 12);

A) No error: the code is correct
B) Logic error: the program does not produce the desired result
C) Syntax error: the code will not compile
D) Exception: the statement will generate an exception
Question
What kind of error is created by the following code snippet?
System.outt.println("Hello");

A) No error: the code is correct
B) Logic error: the program will run until it comes to this statement
C) Syntax error: the program will not compile
D) Exception: the statement will generate an exception
Question
Who or what is responsible for inspecting and testing the program to guard against logic errors?

A) Programmer
B) Integrated Development Environment
C) Compiler
D) End-user
Question
Imagine you are developing an algorithm to calculate the total cost of a purchase order that contains several items. The cost of each item and the tax rate is known. The standard shipping charge for the entire order is $4.95, and the special delivery charge is $19.95. In addition, there is no tax on the shipping cost. Which of the following is the correct pseudocode for the required algorithm?

A) For each item on the purchase order:
Order cost = order cost + item cost
Total purchase order cost = order cost + tax rate + 4.95
B) For each item on the purchase order:
Order cost = order cost + item cost
If standard shipping
Shipping cost = 4.95
Else
Shipping cost = 19.95
Total purchase order cost = order cost * tax rate + shipping cost
C) If standard shipping
Shipping cost = 4.95
Else
Shipping cost = 19.95
For each item on the purchase order:
Order cost = order cost + item cost + shipping cost
Total purchase order cost = order cost * tax rate
D) If special delivery
Shipping cost = 4.95
Else
Shipping cost = 19.95
For each item on the purchase order:
Order cost = order cost + item cost
Total purchase order cost = order cost * tax rate + shipping cost
Question
What is the output of the following code snippet?
<strong>What is the output of the following code snippet?  </strong> A) 4 * 412 B) 4412 C) 1612 D) 28 <div style=padding-top: 35px>

A) 4 * 412
B) 4412
C) 1612
D) 28
Question
In order to translate a Java program to a class file, the computer needs to have software called a(n):

A) assembler
B) virtual machine
C) compiler
D) debugger
Question
The language developed by Sun Microsystems that became the Java programming language was originally designed to be simple, secure, and

A) easy to use in any language
B) available over the Internet
C) usable for many different processor types
D) environmentally friendly, or "green"
Question
In order to run Java programs on a computer, the computer needs to have software called a(n):

A) assembler
B) virtual machine
C) windows
D) debugger
Question
Which one of the following code snippets compiles without errors and displays the output "Hello Good Day!" on the screen?

A) System.out.print("Hello ");
System.out.println("Good Day!");
B) System.out.print("Hello );
System.out.println("Good Day!");
C) System.out.print("Hello ");
System.out.println("Good Day!")
D) System.out.print("Hello ");
System.out.println(Good Day!");
Question
Java is said to be a "safe" programming language. What does this mean?

A) Java programs cannot cause environmental damage because they are "green".
B) Java programs can run within a browser without fear that they may attack your computer.
C) There is no way for a Java program to read or write a file.
D) Java programs cannot access data across a computer network.
Question
Consider the following pseudocode, what does it produce?
Set n = 0.
Set a = 0.
Set b = 1.
Set p = 1.
Print p.
Repeat until n equals 10
Set p = a + b.
Set a = b.
Set b = p.
Add 1 to n.
Print p.

A) 1 3 5 7 9 11 13 15 17 19 21
B) 1 1 2 3 5 8 13 21 34 55 89
C) 1 2 3 4 5 6 7 8 9 10 11
D) 1 3 6 9 12 15 18 21 24 27 30
Question
BIGMART Supermarket has different ways of awarding discounts to its customers for each purchase they make. An 8 percent discount is given on the total value of the purchase. In addition, a standard loyalty discount is given if customers have a permanent customer ID card. Your program should indicate the amount payable by the customer after the discounts. Identify the inputs that the program requires from these options:
I) The discount percentage
II) The total value of the purchase
III) The loyalty-discount amount
IV) The customer ID card number
V) The amount payable after discount

A) I, II, and III
B) I and III
C) II, IV, and V
D) II and IV
Question
A Java virtual machine is:

A) Software
B) Hardware
C) Firmware
D) Applet
Question
What is the output of the following code snippet?
System.out.print("Hello");
System.out.println("Good Day!");

A)Hello Good Day!
B)Hello Good Day!
C) HelloGood Day!
D) HelloGoodDay!
Question
In order for Java to achieve portability

A) compiled Java programs contain instructions for a virtual machine
B) Java is not compiled
C) Java programs must be re-compiled on each platform where they are to run
D) Java programs are based on the C++ programming language
Question
The ENIAC computer burned out transistors at the rate of

A) ten per day
B) one hundred per day
C) several per day
D) None - it used vacuum tubes
Question
Which option correctly completes this statement? Programs can repeat simple instructions very quickly to
I) help human users to perceive images and sound
II) remove the drudgery of repeating instructions by hand
III) overcome the need for connectivity to the computer network

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Question
Consider the following pseudocode, what does it produce?
Set n = 1.
Set p = 0.
Set s = 0.
Repeat until n equals 10
Calculate the square of n and store in s.
Add s to p.
Add 1 to n.
Print p.

A) The product of first 10 even numbers
B) Two raised to the power 10
C) The product of first 10 numbers
D) Sum of square of numbers between 1 and 10
Question
Consider the following pseudocode, what does it produce?
Set n = 1.
Set p = 1.
Repeat until n equals 6
Multiply p by n and store result in p.
Add 1 to n.
Print p.

A) 1 2 6 24 120 720
B) 1 1 2 3 5 8
C) 1 2 3 4 5 6
D) 1 3 6 9 12 15
Question
The Java statement public static void main(String[] args) declares a:

A) class
B) variable
C) constant
D) method
Question
Writing a computer game in Java that has graphics, motion, and sound effects

A) is simple because of the power of Java
B) requires a team of skilled programmers
C) cannot be done in the Java programming language
D) is more mundane than most programs
Question
Consider the following pseudocode. What does it produce?
Set n = 1.
Set p = 1.
Repeat until n equals 20
Multiply p by 2 and store result in p.
Add 1 to n.
Print p.

A) The product of first 20 even numbers
B) Two raised to the power 20
C) The product of first 20 numbers
D) Factorial of 20
Question
Consider the following pseudocode. What does it produce?
Create a list of consecutive integers from two to n: (2, 3, 4, ..., n).
Initially, let p equal 2.
Repeat following steps until p2 is greater than n
Strike from the list all multiples of p less than or equal to n.
Find the first number remaining on the list greater than p.
Replace p with this number.

A) All even numbers up to n
B) All Fibonacci numbers up to n
C) All prime numbers up to n
D) All factorial numbers up to n
Question
Evaluate the pseudocode below to calculate the payment (pmt) with the following test values:
The total number of hours worked (workingHours) = 60
The rate paid for hourly work (rate) = 15
Input workingHours
Input rate
Pmt = workingHours * rate
If workingHours > 40 then
ExtraHours = workingHours - 40
ExtraPmt = extraHours * rate * 2
Pmt = pmt + extraPmt
Output pmt

A) 900
B) 1,200
C) 1,500
D) 1,800
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/96
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 1: Introduction
1
Which of the following refers to a collection of programs that a computer executes?

A) Software
B) Assembler
C) Instructions
D) Source code
A
2
Computer scientists have devised something that allows programmers to describe tasks in words that are closer to the syntax of the problems being solved. This is called a(n)

A) Embedded system
B) Machine instruction
C) High-level programming language
D) Compiler
C
3
High-level programming languages

A) Are made up primarily of ones and zeros
B) Are independent of the underlying hardware
C) Are not standardized
D) Use syntax that is close to the underlying hardware's instruction set
B
4
Which one of the following translates high-level descriptions into machine code?

A) Assembler
B) Linker
C) Compiler
D) Editor
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
5
An integrated development environment (IDE) bundles tools for programming into a unified application. What kinds of tools are usually included?

A) An editor and a compiler
B) A web browser
C) Presentation tools
D) Source files and class files
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
6
Programs that are not running are usually stored

A) in the CPU's memory.
B) on the computer monitor.
C) in secondary storage.
D) on a backup device that is in a different physical location from the computer.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
7
An example of an input device that interfaces between computers and humans is

A) a microphone
B) a monitor
C) a printer
D) a speaker
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
8
Consider the following statements regarding computers:
I) Computers can execute a large number of instructions in a fraction of a second.
II) Computer application areas mainly target the research and scientific communities.
III) The physical components of a computer constitute its hardware.
IV) Unlike humans, a computer never gets bored or exhausted when performing repetitive tasks.
Which one of the following options is correct?

A) Only III is a valid statement.
B) I and III only are valid statements.
C) I, II, and III only are valid statements.
D) I, III, and IV only are valid statements.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
9
A single silicon chip made from potentially millions of transistors is called

A) a Central Processing Unit (CPU).
B) secondary Storage.
C) a Hard Disk.
D) an Optical Disk (such as a DVD).
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
10
What is one of the benefits of using a high-level programming language like Java?

A) Its syntax is very similar to the hardware instruction set
B) No tools other than a text editor are required for programming
C) Statements in the high-level language are just like English
D) Problems solved in a high-level language are independent of the underlying computer hardware
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
11
Consider the following statements about computer programs:
I) Computer programs can be written by someone who has a basic knowledge of operating a computer.
II) Computer programs can complete complex tasks quickly.
III) Large and complex computer programs are generally written by a group of programmers.
IV) Computer programs are composed of extremely primitive operations.
Which one of the following options is correct?

A) II and III only are correct statements.
B) I, II, III and IV are correct statements.
C) II, III, and IV only are correct statements.
D) I and IV only are correct statements.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
12
Which one of the following typically provides data persistence without electricity?
I) The CPU's memory
II) The hard disk
III) Secondary storage

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
13
The Central Processing Unit is primarily responsible for

A) performing program control and data processing.
B) ensuring data persists when electrical power is turned off.
C) enabling a human user to interact with the computer.
D) interconnecting computers that are separated by distance.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
14
Computer programming is

A) the speed with which a computer operates.
B) the collection of peripheral devices connected to a computer.
C) the storage of data in the form of words and pictures.
D) the act of designing and implementing a computer program.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
15
Consider a scenario in which you develop a Java program on a computer that has a Pentium processor. What step should you take to run the same Java program on a computer that has a different processor?

A) The compiled Java machine language instructions can be run on any processor that has a Java Virtual Machine.
B) Develop the same program again on the computer that has a different processor and recompile the program.
C) Recompile the program on the computer that has a different processor.
D) You cannot run the program on a computer with a different processor because high-level programming languages are machine dependent.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
16
When a program begins to run,

A) It is moved from DVD to hard disk.
B) It is moved to the CPU's memory.
C) It is moved from the CPU's memory to hard disk.
D) It must be connected to a computer network.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
17
Because Java was designed for the Internet, which two of its attributes make it suitable for beginning programmers?

A) Efficiency and portability
B) Safety and security
C) Safety and portability
D) Efficiency and security
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
18
An example of an output device that interfaces between computers and humans is

A) a keyboard.
B) a mouse.
C) a speaker.
D) a microphone.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
19
Computers are machines that

A) design computer programs.
B) execute programs.
C) carry out a very narrow range of tasks.
D) are imprecise and slow.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
20
Small applications written in the Java programming language that can be located anywhere on the Internet are called

A) Applets
B) Compilers
C) Embedded systems
D) Virtual machines
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
21
What kind of error is it when your program has a syntax error?

A) Compile-time error
B) Logic error
C) Run-time error
D) Exception
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
22
Suppose you examine a simple Java program and the first line is public Class HelloPrinter. Is this the same thing in Java as the line public Class helloprinter?

A) No, because Java is case-sensitive, these are considered to be completely distinct
B) No, because "helloprinter" is misspelled, the Java compiler will reject it
C) Yes, because these Java symbols both have the same letters, they are considered to be the same
D) Yes, because all Java symbols must have exactly twelve characters.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
23
What is the difference between an editor and a compiler?

A) An editor converts program files into an executable program; a compiler allows program files to be written and stored
B) An editor allows program files to be written and stored; a compiler produces an organized list of files
C) An editor allows program files to be written and stored; a compiler produces an indexed database of terms and keywords
D) An editor allows program files to be written and stored; a compiler converts program files into an executable program
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
24
Which of the following statements is true with respect to the main method in Java?

A) The opening and closing parentheses after the method name main are optional.
B) A semicolon is required after the statement public static void main()
C) A semicolon is required after the closing curly braces in the main method.
D) Every Java application must have a main method.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
25
These two lines of code do not produce the same output. Why?
System.out.println(7 + 3);
System.out.println("7 + 3");

A) Arithmetic calculations cannot take place within the println method call.
B) In fact, the two statements do produce the same output.
C) The quotes cause the second expression to be treated as a string.
D) Because there are no escape characters.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
26
What statements about the integrated development environment (IDE) are true?
I) You may run Java class files even after exiting the IDE.
II) The IDE can invoke a virtual machine, which is required to run a Java program.
III) Translating Java source code into class files is enough to then actually run the program.

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
27
Consider the following statements about folders and your integrated development environment (IDE):
I) Hierarchical folders help to organize a project.
II) Folders are a way to visualize the layout of a file system.
III) Folders make it impossible to lose or accidentally delete a file.

A) Only I is correct
B) I, II, and III are correct
C) Only I and II are correct
D) Only III is correct
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following statements regarding backup strategies for Java files are true?
I) You should back up your projects often to prevent loss of valuable work.
II) You should check your backups only in case of loss of data.
III) You should pay attention to the backup direction.

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
29
Which Java statement prints a blank line?

A) public static void main(String[] args)
B) System.out.print();
C) System.out.println();
D) System.out.Println();
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
30
Characters that are grouped together between double quotes (quotation marks) in Java are called

A) reserved words
B) syntax
C) symbols
D) strings
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
31
Which Java statement does not contain an error?

A) System.out.print(;
B) System.out.print()
C) System.out.printl();
D) System.out.println();
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
32
Which of the following are reasons why Java is good, but not perfect, for beginners?
I) A certain amount of technical machinery is necessary to write basic, simple programs
II) There are many extensions
III) There are a large number of extensive libraries in Java

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
33
What is the output from this code snippet?
System.out.print("The sum is ");
System.out.println("7 + 3");

A) The sum is 10
B) The sum is 21
C) The sum is 4
D) The sum is 7 + 3
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
34
Which of the following symbols is used to terminate a Java program statement?

A) Colon
B) Semicolon
C) Single quote
D) Period
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
35
Which statement starts the declaration of a class in Java?

A) public static void main(String[] args)
B) public class Classname
C) System.out.println("Hello, World!");
D) Java class
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
36
What is the output of the following code snippet?
System.out.print(4 + 4);
System.out.print(12);

A) 4 + 412
B) 4412
C) 812
D) 20
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following statements is valid with respect to the usage of a semicolon in Java?

A) A semicolon is used to denote the end of a statement.
B) A semicolon is used to terminate the public class statement.
C) You cannot use a semicolon to terminate the System.out.print statement.
D) You cannot put a semicolon within double quotation marks.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
38
A Java class with the name Printer has to be saved using the source file name:

A) printer.java
B) Printer.java
C) Printer.txt
D) printer.java
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
39
Every statement in Java must be terminated with
)

A) the semi-colon character ;.
B) a carriage return.
C) System.out.println().
D) an escape sequence.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
40
Every Java program consists of one or more

A) Values (arguments)
B) Classes
C) Strings
D) System.out.println statements
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
41
What is the purpose of the following algorithm?
SomeNum = 0
Repeat the following steps 50 times
Input variable1
If variable1 > someNum
SomeNum = variable1
Print someNum

A) To find the largest of 50 numbers
B) To print out the 50 numbers
C) To find the smallest of 50 numbers
D) To search for a particular number among 50 numbers
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
42
Imagine you are planning to purchase a new cable TV dish. You are considering two cable TV dishes that have different purchase prices. Each channel service provider charges a different rate for each month that the cable TV dish is used. To determine which cable TV dish is the better buy, you need to develop an algorithm to calculate the total cost of purchasing and using each cable TV dish. What are all of the inputs that you need for this algorithm?

A) The cost of each cable TV dish and the rate for each month for using each cable TV dish
B) The cost of each cable TV dish and the number of months provided with each cable TV dish
C) The cost of each cable TV dish, the rate per month for using each cable TV dish, and the number of months provided with each cable TV dish
D) The cost of each cable TV dish, the rate per month for using each cable TV dish, and the number of months you would use the cable TV dish
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
43
Consider a situation where you are buying videos online. The video seller charges $21.50 as the price per video and $6.75 as the handling cost for up to three videos. For every video purchased in addition to three videos, there is a handling charge of $1.50. In addition, there is a 9 percent tax on the cost of the videos but not on the handlingCharges. Assuming that numVideos represents the number of videos you are purchasing, which of the following is the correct algorithm for calculating the total cost of your purchase?

A) Total charge for videos = 21.50 * numVideos
Tax on the videos = numVideos * .9
If (numVideos <= 3) then handlingCharges = 6.75
Else handlingCharges = 1.50 * numVideos
Total cost of order = total charge for videos + tax + handlingCharges
B) Total charge for videos = 21.50 * numVideos
Tax on the videos = total charge for videos * .9
If (numVideos = 3) then handlingCharges = 6.75
Else handlingCharges = 1.50 * numVideos
Total cost of order = total charge for videos + tax + handlingCharges
C) Total charge for videos = 21.50 * numVideos
Tax on the videos = numVideos * .09
If (numVideos < 3) then handlingCharges = 6.75
Else handlingCharges = 6.75 + 1.50 * (numVideos - 3)
Total cost of order = total charge for videos + tax + handlingCharges
D) Total charge for videos = 21.50 * numVideos
Tax on the videos = total charge for videos * .09
If (numVideos <= 3) then handlingCharges = 6.75
Else handlingCharges = 6.75 + 1.50 * (numVideos - 3)
Total cost of order = total charge for videos + tax + handlingCharges
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
44
Imagine you are planning to buy a new cell phone. You are considering two cell phones. These cell phones have different purchase prices. Each mobile service provider charges a different rate for each minute that the cell phone is used. To determine which cell phone is the better buy, you need to develop an algorithm to calculate the total cost of purchasing and using each cell phone. What are all the inputs needed for this algorithm?

A) The cost of each cell phone and the rate for each minute for each cell phone
B) The cost of each cell phone and the number of minutes provided with each cell phone
C) The cost of each cell phone, the rate per minute for each cell phone, and the number of minutes provided with each cell phone
D) The cost of each cell phone, the rate per minute for each cell phone, and the number of minutes you would use the cell phone
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
45
Consider a situation where you are buying books online. The bookseller charges $19.95 as the price per book and $4.95 as the handling cost for up to three books. For every book purchased in addition to three books, there is a handling charge of $1.50. In addition, there is a 7 percent tax on the cost of the books but not on the handlingCharges. Assuming that numBooks represents the number of books you are purchasing, which of the following is the correct algorithm for calculating the total cost of your purchase?

A) Total charge for books = 19.95 * numBooks
Tax on the books = numBooks * .7
If (books <= 3) then handlingCharges = 4.95
Else handlingCharges = 1.50 * numBooks
Total cost of order = total charge for books + tax + handlingCharges
B) Total charge for books = 19.95 * numBooks
Tax on the books = total charge for books * .07
If (books = 3) then handlingCharges = 4.95
Else handlingCharges = 1.50 * numBooks
Total cost of order = total charge for books + tax + handlingCharges
C) Total charge for books = 19.95 * numBooks
Tax on the books = numBooks * .07
If (books < 3) then handlingCharges = 4.95
Else handlingCharges = 4.95 + 1.50 * (numBooks - 3)
Total cost of order = total charge for books + tax + handlingCharges
D) Total charge for books = 19.95 * numBooks
Tax on the books = total charge for books * .07
If (books <= 3) then handlingCharges = 4.95
Else handlingCharges = 4.95 + 1.50 * (numBooks - 3)
Total cost of order = total charge for books + tax + handlingCharges
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
46
What is the purpose of the following algorithm, written in pseudocode?
Num = 0
Repeat the following steps 10 times
Input var1
If var1 > num
Num = var1
Print num

A) To find the highest among 10 numbers
B) To print out the 10 numbers
C) To find the smallest among 10 numbers
D) To search for a particular number among 10 numbers
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
47
While developing a program, the programmer adds the discount amount to the total due instead of subtracting it. What type of an error is this?

A) A syntax error
B) A logic error
C) A hardware error
D) A compile-time error
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
48
UML Supermarket has different ways of awarding discounts to its customers for each purchase they make. A 10 percent discount is given on the total value of the purchase. In addition, a standard loyalty discount is given if customers have a permanent customer card. Your program should indicate the amount payable by the customer after the discounts. Identify the inputs that the program requires from these options:
I) The discount percentage
II) The total value of the purchase
III) The loyalty-discount amount
IV) The customer card number
V) The amount payable after discount

A) I, II, and III
B) I and III
C) II, IV, and V
D) II and IV
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
49
Which one of the following errors represents a part of a program that is incorrect according to the rules of the programming language?

A) Syntax errors
B) Run-time errors
C) Logic errors
D) Out-of-memory errors
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
50
When a compiler finds a syntax error in a program, what happens?

A) The compiler goes ahead and produces a Java class file, but leaves out the statement where there was an error.
B) The compiler stops immediately.
C) The compiler requests input from the user before it will continue.
D) The compiler continues and may report about other errors but does not produce a Java class file.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
51
Evaluate the pseudocode below to calculate the payment (pmt) with the following test values:
The total number of hours worked (workingHours) = 50
The rate paid for hourly work (rate) = 10
Input workingHours.
Input rate.
Pmt = workingHours * rate
If working_hours > 45
ExtraHours = workingHours - 45
ExtraPmt = extraHours * rate * 2
Pmt = pmt + extraPmt
Output pmt

A) 400
B) 500
C) 600
D) 1,000
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
52
You have been asked to develop an algorithm to calculate the total cost of a purchase order that contains several T shirts. The cost of each T shirt and the tax rate is known. The standard shipping charge for the entire order is $5.75, and the special delivery charge is $23.65. In addition, there is no tax on the shipping cost. Which of the following is the correct pseudocode for the required algorithm?

A) For each T shirt on the purchase order:
Order cost = order cost + T shirt cost
Total purchase order cost = order cost + tax rate + 5.75
B) For each T shirt on the purchase order:
Order cost = order cost + T shirt cost
If standard shipping
Shipping cost = 5.75
Else
Shipping cost = 23.65
Total purchase order cost = order cost * tax rate + shipping cost
C) If standard shipping
Shipping cost = 5.75
Else
Shipping cost = 23.65
For each T shirt on the purchase order:
Order cost = order cost + T shirt cost + shipping cost
Total purchase order cost = order cost * tax rate
D) If special delivery
Shipping cost = 5.75
Else
Shipping cost = 23.65
For each T shirt on the purchase order:
Order cost = order cost + T shirt cost
Total purchase order cost = order cost * tax rate + shipping cost
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
53
Which one of the following methodologies is a sequence of steps formulated in English for solving a problem?

A) Flowcharts
B) Pseudocode
C) Algorithms
D) Terminations
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
54
How do programmers find exceptions and run-time errors?

A) Using the compiler
B) Testing by running the program with a variety of input values
C) Carefully reading over the program code
D) Re-compiling using different symbols
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
55
What is a logic error?

A) An error that occurs when a program is running because, for example, the wrong operator was used.
B) An error in a statement that does not conform to the syntax of the programming language.
C) An error in the hardware from overheating.
D) An error introduced by the compiler when it guesses at how to fix a syntax error.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
56
The programmer, not the compiler, is responsible for testing a program to identify

A) Syntax errors
B) Compile-time errors
C) Run-time errors
D) Undefined symbols
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
57
What kind of error is created by the following code snippet?
System.out.print("The sum of 8 and 12 is ");
System.out.println(8 * 12);

A) No error: the code is correct
B) Logic error: the program does not produce the desired result
C) Syntax error: the code will not compile
D) Exception: the statement will generate an exception
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
58
What kind of error is created by the following code snippet?
System.outt.println("Hello");

A) No error: the code is correct
B) Logic error: the program will run until it comes to this statement
C) Syntax error: the program will not compile
D) Exception: the statement will generate an exception
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
59
Who or what is responsible for inspecting and testing the program to guard against logic errors?

A) Programmer
B) Integrated Development Environment
C) Compiler
D) End-user
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
60
Imagine you are developing an algorithm to calculate the total cost of a purchase order that contains several items. The cost of each item and the tax rate is known. The standard shipping charge for the entire order is $4.95, and the special delivery charge is $19.95. In addition, there is no tax on the shipping cost. Which of the following is the correct pseudocode for the required algorithm?

A) For each item on the purchase order:
Order cost = order cost + item cost
Total purchase order cost = order cost + tax rate + 4.95
B) For each item on the purchase order:
Order cost = order cost + item cost
If standard shipping
Shipping cost = 4.95
Else
Shipping cost = 19.95
Total purchase order cost = order cost * tax rate + shipping cost
C) If standard shipping
Shipping cost = 4.95
Else
Shipping cost = 19.95
For each item on the purchase order:
Order cost = order cost + item cost + shipping cost
Total purchase order cost = order cost * tax rate
D) If special delivery
Shipping cost = 4.95
Else
Shipping cost = 19.95
For each item on the purchase order:
Order cost = order cost + item cost
Total purchase order cost = order cost * tax rate + shipping cost
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
61
What is the output of the following code snippet?
<strong>What is the output of the following code snippet?  </strong> A) 4 * 412 B) 4412 C) 1612 D) 28

A) 4 * 412
B) 4412
C) 1612
D) 28
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
62
In order to translate a Java program to a class file, the computer needs to have software called a(n):

A) assembler
B) virtual machine
C) compiler
D) debugger
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
63
The language developed by Sun Microsystems that became the Java programming language was originally designed to be simple, secure, and

A) easy to use in any language
B) available over the Internet
C) usable for many different processor types
D) environmentally friendly, or "green"
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
64
In order to run Java programs on a computer, the computer needs to have software called a(n):

A) assembler
B) virtual machine
C) windows
D) debugger
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
65
Which one of the following code snippets compiles without errors and displays the output "Hello Good Day!" on the screen?

A) System.out.print("Hello ");
System.out.println("Good Day!");
B) System.out.print("Hello );
System.out.println("Good Day!");
C) System.out.print("Hello ");
System.out.println("Good Day!")
D) System.out.print("Hello ");
System.out.println(Good Day!");
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
66
Java is said to be a "safe" programming language. What does this mean?

A) Java programs cannot cause environmental damage because they are "green".
B) Java programs can run within a browser without fear that they may attack your computer.
C) There is no way for a Java program to read or write a file.
D) Java programs cannot access data across a computer network.
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
67
Consider the following pseudocode, what does it produce?
Set n = 0.
Set a = 0.
Set b = 1.
Set p = 1.
Print p.
Repeat until n equals 10
Set p = a + b.
Set a = b.
Set b = p.
Add 1 to n.
Print p.

A) 1 3 5 7 9 11 13 15 17 19 21
B) 1 1 2 3 5 8 13 21 34 55 89
C) 1 2 3 4 5 6 7 8 9 10 11
D) 1 3 6 9 12 15 18 21 24 27 30
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
68
BIGMART Supermarket has different ways of awarding discounts to its customers for each purchase they make. An 8 percent discount is given on the total value of the purchase. In addition, a standard loyalty discount is given if customers have a permanent customer ID card. Your program should indicate the amount payable by the customer after the discounts. Identify the inputs that the program requires from these options:
I) The discount percentage
II) The total value of the purchase
III) The loyalty-discount amount
IV) The customer ID card number
V) The amount payable after discount

A) I, II, and III
B) I and III
C) II, IV, and V
D) II and IV
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
69
A Java virtual machine is:

A) Software
B) Hardware
C) Firmware
D) Applet
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
70
What is the output of the following code snippet?
System.out.print("Hello");
System.out.println("Good Day!");

A)Hello Good Day!
B)Hello Good Day!
C) HelloGood Day!
D) HelloGoodDay!
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
71
In order for Java to achieve portability

A) compiled Java programs contain instructions for a virtual machine
B) Java is not compiled
C) Java programs must be re-compiled on each platform where they are to run
D) Java programs are based on the C++ programming language
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
72
The ENIAC computer burned out transistors at the rate of

A) ten per day
B) one hundred per day
C) several per day
D) None - it used vacuum tubes
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
73
Which option correctly completes this statement? Programs can repeat simple instructions very quickly to
I) help human users to perceive images and sound
II) remove the drudgery of repeating instructions by hand
III) overcome the need for connectivity to the computer network

A) I, II only
B) I, III only
C) II, III only
D) I, II, III
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
74
Consider the following pseudocode, what does it produce?
Set n = 1.
Set p = 0.
Set s = 0.
Repeat until n equals 10
Calculate the square of n and store in s.
Add s to p.
Add 1 to n.
Print p.

A) The product of first 10 even numbers
B) Two raised to the power 10
C) The product of first 10 numbers
D) Sum of square of numbers between 1 and 10
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
75
Consider the following pseudocode, what does it produce?
Set n = 1.
Set p = 1.
Repeat until n equals 6
Multiply p by n and store result in p.
Add 1 to n.
Print p.

A) 1 2 6 24 120 720
B) 1 1 2 3 5 8
C) 1 2 3 4 5 6
D) 1 3 6 9 12 15
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
76
The Java statement public static void main(String[] args) declares a:

A) class
B) variable
C) constant
D) method
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
77
Writing a computer game in Java that has graphics, motion, and sound effects

A) is simple because of the power of Java
B) requires a team of skilled programmers
C) cannot be done in the Java programming language
D) is more mundane than most programs
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
78
Consider the following pseudocode. What does it produce?
Set n = 1.
Set p = 1.
Repeat until n equals 20
Multiply p by 2 and store result in p.
Add 1 to n.
Print p.

A) The product of first 20 even numbers
B) Two raised to the power 20
C) The product of first 20 numbers
D) Factorial of 20
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
79
Consider the following pseudocode. What does it produce?
Create a list of consecutive integers from two to n: (2, 3, 4, ..., n).
Initially, let p equal 2.
Repeat following steps until p2 is greater than n
Strike from the list all multiples of p less than or equal to n.
Find the first number remaining on the list greater than p.
Replace p with this number.

A) All even numbers up to n
B) All Fibonacci numbers up to n
C) All prime numbers up to n
D) All factorial numbers up to n
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
80
Evaluate the pseudocode below to calculate the payment (pmt) with the following test values:
The total number of hours worked (workingHours) = 60
The rate paid for hourly work (rate) = 15
Input workingHours
Input rate
Pmt = workingHours * rate
If workingHours > 40 then
ExtraHours = workingHours - 40
ExtraPmt = extraHours * rate * 2
Pmt = pmt + extraPmt
Output pmt

A) 900
B) 1,200
C) 1,500
D) 1,800
Unlock Deck
Unlock for access to all 96 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 96 flashcards in this deck.