Most Web pages are created using a markup language called a.HTTP. b.URL. c.FTP. d.HTML. d Which application is used to view HTML documents that have been published to a Web server? a.Notepad b.a text editor c.a Web browser d.a word processor c Which extension must be included with an HTML document file name? a..txt b..htm c..exe d..docx b Which is a valid file name for an HTML document? a.my_hobbies.txt b.my_hobbies.htm c.My Hobbies.htm d.MY*HOBBIES.txt b In a JavaScript, a // is used to a.specify which scripting language is used to define the scripts. b.display an alert dialog box. c.add a single line comment to a script. d.end a JavaScript statement. c In a JavaScript, a semicolon(;) is used to a.specify which scripting language is used to define the scripts. b.display an alert dialog box. c.add a single line comment to a script. d.end a JavaScript statement. d In a JavaScript, prompt() a.displays a prompt dialog box. b.displays an alert dialog box. c.displays a single line comment to a script. d.displays a JavaScript statement. a Where in a browser window will "Hello World" be displayed if the statement window.defaultStatus="Hello World"; is interpreted? a.status bar b.title bar c.Web browser window d.it will not be displayed a In the code for a Java applet, which method is used to draw a message on the screen at specified coordinates? a.init() b.paint() c.setColor() d.drawString() d Which is not a parameter required by the tag? a.name of the applet b.background color c.width d.height b Which tag is used to move a line of text within a paragraph to the next line? a.

b.
c.


d. b Java was developed by a.Microsoft. b.Apple. c.Sun Microsystems. d.W3C. c Which is another name for package? a.object b.library c.method d.string b Sets of instructions in program code are called a.objects. b.methods. c.statements. d.comments. c Which is a named set of statements that perform a single, well-defined task? a.object b.method c.comment d.argument b Which statement displays Hello, world! on the screen? a.System.out.println('Hello, world!'); b.System.out.println("Hello, world!"); c.System.println('Hello, world!'); d.System.println("Hello, world!"); b Which is not a correct Java comment? a./* comment */ b.// comment c./** comment */ d.** comment d Which of the following represent correctly-formed comments? ~I.// Happy ~II./* Sorry /* ~III. /* Wise */ a.I only b.I and II only c.I and III only d.III only c Which occurs in a statement that violates the rules of Java? a.a logic error b.an output error c.a syntax error d.an argument c To display a double quotation mark (") as part of string output, a.place the double quotation mark within double quotation marks ("). b.place the double quotation mark within a comment. c.precede the double quotation mark with a single quotation mark ('). d.precede the double quotation mark with a back slash (/). d public class MulticulturalGoodbye ~{ ~public static void main(String[] args) ~{ ~System.out.println("good-bye"); ~System.out.print("adios"); ~System.out.println("au voire"); ~} ~} ~Which is a string argument in Multicultural Goodbye? a.public b.System.out.print c."good-bye" d.} c Which method controls the way output is displayed? a.format() b.main() c.print() d.println() a Which outlines a solution using a mix of English and program code? a.flow chart b.Java code c.pseudocode d.source code c Which is a set of steps that tell how to solve a problem? a.algorithm b.argument c.Java application d.package a Which method displays output to the screen and then moves the insertion point to the next line? a.format() b.main() c.print() d.println() d Which is a valid identifier? a.$12 b.void c.55 d.diameter d Which is a valid declaration statement? a.int height int width; b.int height, width; c.int height; width; d.int height, int width; b How many values can a variable store at one time? a.1 b.2 c.5 d.10 a Which operator is used to assign a new value to a variable? a.= b.== c.* d.- a Which statement assigns the value 15 to radius? a.radius = 15; b.radius == 15; c.15 = radius; d.15radius; a What is the final value of finalNumber after the last statement executes? ~int startingNumber = 10; ~int finalNumber = 25; ~startingNumber = finalNumber / 5; ~finalNumber = startingNumber + 5; a.5 b.10 c.20 d.25 b Which data type declares a variable that stores a true or false value? a.int b.double c.char d.boolean d Which data type declares a variable that stores a positive or negative whole number? a.int b.double c.char d.boolean a Which data type is most appropriate for whether an employee qualifies for a bonus? a.int b.double c.boolean d.char c Which data type is most appropriate for an employee's salary? a.int b.double c.boolean d.char b Which term describes creating a new object? a.initialize b.instantiation c.concatenate d.literal b A variable declared with a class is called a(n) a.method. b.identifier. c.keyword. d.object. d In the statement import java.util.*; the * indicates a.that all members of the util package are to be accessible. b.that all members of the util package that start with * are to be accessible. c.that no members of the util package are to be accessible. d.that all members of the java.lang package are to be accessible. a Which Scanner class method is used to return a string that does not contain spaces from the input stream? a.nextBoolean() b.nextInt() c.nextLine() d.next() d Which should be used to let a user know what input is expected in an application? a.a variable b.an identifier c.a prompt d.a keyword c Which operator is used for modulus division? a./ b.\ c.% d.# c What is the result of the following expression when x is 3576? ~(x/10)%10 a.6 b.7 c.76 d.357 b What is the result of the following expression when x is 125? ~x%6 a.0 b.5 c.20 d.20.5 b What happens to the decimal portion of a number when a double is cast to an int? a.The decimal portion is truncated. b.The decimal portion is rounded. c.Nothing, a syntax error occurs. d.The value 0.5 is added to the number. a Which expression does not evaluate to 0.6? a.6.0 / 10; b.6 / 10.0; c.(int)6.5 / (double)10; d.(double) (6 / 10); d Which keyword does a constant declaration begins with? a.import b.constant c.int d.final d Which statement declares a constant named PRICE with a value of 5.25? a.final PRICE = 5.25; b.double PRICE = $5.25; c.const double PRICE = 5.25; d.final double PRICE = 5.25; d Which code segment displays the circle area when the radius is a positive value? a.if (radius!=0) ~{ ~System.out.println("The radius is: " + radius * radius * Math.PI); ~} b.if (radius>=0) ~{ ~System.out.println("The radius is: " + radius * radius * Math.PI); ~} c.if (radius>0) ~{ ~System.out.println("The radius is: " + radius * radius * Math.PI); ~} d.if (radius==0) ~{ ~System.out.println("The radius is: " + radius * radius * Math.PI); ~} c Given the following code segment: ~if (guess == selected) ~{ ~System.out.println("Correct"); ~} ~else ~{ ~System.out.println("Incorrect"); ~} ~Which is displayed when guess is 8 and selected is 9? a.Correct b.Incorrect c.No message would be displayed. d.Correct on one line and Incorrect on the next line b Given the following code segment: ~boolean finished = false; ~if (finished) ~{ ~System.out.println("Game finished"); ~} ~else ~{ ~System.out.println("Next round"); ~} ~Which will be displayed when the code segment is run? a.false b.Game finished c.Next round d.A syntax error will be generated because (finished) is not a correct Boolean expression. c Which statement should be used to decide among three or more actions? a.if statement b.if-else statement c.nested if-else statement d.if-else-if statement d Given the following code segment: ~if (x > 0) ~{ ~if (y > 0) ~{ ~System.out.println("x and y "); ~} ~else if (z > 0) ~{ ~System.out.println("x and z "); ~} ~} ~Which is displayed when x = 56, y = -234, and z = -45? a.x and y b.x and z c.56 and -45 d.No output will be displayed. d Which will be displayed when the code segment below is run? ~ double grossPay = 4250.50; ~if (grossPay > 3000) {~ System.out.println("Your tax rate is 33%");~} else if (grossPay > 4000) { ~ System.out.println("Your tax rate is 35%"); ~} a.Your tax rate is 33% b.Your tax rate is 35% c.Your tax rate is 33% ~ Your tax rate is 35% d.A run-time error will be generated. a Given the following code segment:~x = 1;~switch (x)~{~case 1: y = 0; ~case 2: y = 1;~default: y += 1;~}~System.out.println(y); ~What would be displayed when the segment is run? a.0 b.1 c.2 d.3 c In a switch statement, which code is executed if none of the previous cases are met? a.the break statement b.the last case clause c.the default clause d.No statements are executed. c In a switch statement, which is used to move the program control to the next statement? a.break; b.next case; c.default; d.No statement is required. d Which statement generates random numbers in the range from 10 to 50? a.(50 - 10 + 1) * Math.random() + 10; b.(50 - 10) * Math.random(); c.(50 - 10) * Math.random() + 1; d.(10 - 50) * Math.random(); a Which statement generates random numbers in the range from 0 to 100? a.101 * Math.random(); b.100 * Math.random(); c.(0 - 100) * Math.random(); d.(100 - 0) * Math.random() + 100; a Given the following code segment: ~public static void main(String[] args) ~{ ~System.out.println(Math.random()); ~} ~What is range of the random number generated? a.between 0.0 and 100.0 b.between 1.0 and 10.0 c. between 0.0 and 1.0 d.No random number will be generated because no range was indicated. c Which statement is used to generate a random integer between 5 and 10? a.i = Math.random(5); b.i = (10 - 5) * Math.random() + 5; c.i = (6 * Math.random() + 5); d.i = (int)(6 * Math.random() + 5); d Given the following code segment: ~if (x < 50) && (x > 0) ~{ ~System.out.println("The value is in the approved range"); ~} ~Which is true? a.A syntax error will be generated because (x < 50) && (x > 0) must be written as (x < 50 && x > 0). b.A syntax error will be generated because && should be &. c.A syntax error will be generated because a semicolon is missing at the end of the if condition. d.The code segment will compile without errors. a Which is equivalent to the expression !(x && y)? a.(!x) || (!y) b.! (x || y) c.(x || y) && (x && y) d.(x || y) a In which situation would the expression (!x && y) || !(!x || y) evaluate to true? a.if x and y both have the initial value true b.if x and y both have the initial value false c.if x has the value true and y has the value false d.the expression would never evaluate to true c Which is not a logical operator? a.And b.Or c.ot d.if d Which statement will display the value of 4.0? a.System.out.println(Math.sqrt(2)); b.System.out.println(Math.abs(-16)); c.System.out.println(Math.pow(2, 2)); d.System.out.println(Math.pow(2)); c Given the following code segment: ~double x = 5.86859; ~int y = 100; ~int calculation = (int)(x * Math.pow(y, 2)); ~System.out.println(calculation); ~Which is the correct output? a.10000 b.8685 c.58686 d.586859 b