Exam 2: Data and Expressions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

As presented in the Software Failure, the root cause of the Mars Climate Orbiter problem was

Free
(Multiple Choice)
4.8/5
(37)
Correct Answer:
Verified

D

A cast is required in which of the following situations?

Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
Verified

D

If String a = "ABCD" and String b = "abcd" then a.equals(b); returns false but a.equalsIgnoreCase(b); returns True.

Free
(True/False)
4.8/5
(38)
Correct Answer:
Verified

True

In order to create a constant, you would use which of the following Java reserved words?

(Multiple Choice)
4.8/5
(40)

If the String major = "Computer Science", what is returned by major.charAt(1)?

(Multiple Choice)
4.8/5
(44)

Use the following class definition to answer the questions below. public class Questions1_4 { public static void main(String[ ] args) { System.out.print("Here"); System.out.println("There " + "Everywhere"); System.out.println("But not" + "in Texas"); } } -If you want to output the text "hi there", including the quote marks, which of the following could do that?

(Multiple Choice)
4.9/5
(34)

If String name = "George W. Bush"; then the instruction name.length( ); will return 14.

(True/False)
4.8/5
(34)

Write an output statement which will output the following characters exactly as shown: / ' \" / ' \

(Essay)
4.8/5
(34)

Given two points in an applet represented by the four int variables x1, y1, x2 and y2, write a paint method to draw a line between the two points and write the location of the two points next to the two points.

(Essay)
4.8/5
(35)

How do the statements "import java.util.*;" and "import java.util.Random;" differ from each other?

(Essay)
4.9/5
(40)

Using getCurrencyInstance( ) formats a variable, automatically inserting

(Multiple Choice)
4.8/5
(31)

Which of the following is True regarding the mod operator, %?

(Multiple Choice)
4.8/5
(34)

Use the following class definition to answer the questions below. public class Questions1_4 { public static void main(String[ ] args) { System.out.print("Here"); System.out.println("There " + "Everywhere"); System.out.println("But not" + "in Texas"); } } -Consider the following statement: System.out.println("1 big bad wolf\t8 the 3 little pigs\n4 dinner\r2night"); This statement will output ________ lines of text

(Multiple Choice)
4.9/5
(38)

Use the following class definition to answer the questions below. public class Questions1_4 { public static void main(String[ ] args) { System.out.print("Here"); System.out.println("There " + "Everywhere"); System.out.println("But not" + "in Texas"); } } -A reasonable documentation comment for this program might be

(Multiple Choice)
4.9/5
(36)

What value will z have if we execute the following assignment statement? Int z = 50 / 10.00;

(Multiple Choice)
4.8/5
(38)

If you want to draw a red circle inside of a green square in an applet where the paint method is passed a Graphics object called page, which of the following sets of commands might you use?

(Multiple Choice)
4.8/5
(34)

The Random class has a method nextFloat( ) which returns a random float value between

(Multiple Choice)
4.9/5
(40)

If you want to output a double so that at least 1 digit appears to the left side of the decimal point and exactly 1 digit appears to the right side of the decimal point, which pattern would you give a DecimalFormat variable when you instantiate it?

(Multiple Choice)
4.8/5
(33)

Use the following class definition to answer the questions below. public class Questions1_4 { public static void main(String[ ] args) { System.out.print("Here"); System.out.println("There " + "Everywhere"); System.out.println("But not" + "in Texas"); } } -How many lines of output are provided by this program?

(Multiple Choice)
4.8/5
(44)

If you want to store into the String name the value "George Bush", you would do which statement?

(Multiple Choice)
4.9/5
(38)
Showing 1 - 20 of 77
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)