Deck 1: Introduction

ملء الشاشة (f)
exit full mode
سؤال
Which of the following refers to a collection of programs that a computer executes?

A) Software
B) Assembler
C) Instructions
D) Source code
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
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
سؤال
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
سؤال
Which one of the following translates high-level descriptions into machine code?

A) Assembler
B) Linker
C) Compiler
D) Editor
سؤال
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
سؤال
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.
سؤال
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
سؤال
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.
سؤال
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).
سؤال
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
سؤال
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.
سؤال
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
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
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.
سؤال
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
سؤال
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.
سؤال
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.
سؤال
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
سؤال
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
سؤال
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.
سؤال
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
سؤال
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.
سؤال
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.
سؤال
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
سؤال
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
سؤال
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
سؤال
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();
سؤال
Characters that are grouped together between double quotes (quotation marks) in Java are called

A) reserved words
B) syntax
C) symbols
D) strings
سؤال
Which Java statement does not contain an error?

A) System.out.print(;
B) System.out.print()
C) System.out.printl();
D) System.out.println();
سؤال
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
سؤال
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
سؤال
Which of the following symbols is used to terminate a Java program statement?

A) Colon
B) Semicolon
C) Single quote
D) Period
سؤال
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
سؤال
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
سؤال
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.
سؤال
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
سؤال
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.
سؤال
Every Java program consists of one or more

A) Values (arguments)
B) Classes
C) Strings
D) System.out.println statements
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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.
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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.
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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"
سؤال
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
سؤال
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!");
سؤال
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.
سؤال
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
سؤال
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
سؤال
A Java virtual machine is:

A) Software
B) Hardware
C) Firmware
D) Applet
سؤال
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!
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
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
سؤال
The Java statement public static void main(String[] args) declares a:

A) class
B) variable
C) constant
D) method
سؤال
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
سؤال
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
سؤال
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
سؤال
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 Deck
1/96
auto play flashcards
العب
simple tutorial
ملء الشاشة (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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
k this deck
40
Every Java program consists of one or more

A) Values (arguments)
B) Classes
C) Strings
D) System.out.println statements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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!");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
k this deck
69
A Java virtual machine is:

A) Software
B) Hardware
C) Firmware
D) Applet
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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!
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
k this deck
76
The Java statement public static void main(String[] args) declares a:

A) class
B) variable
C) constant
D) method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 96 في هذه المجموعة.