Exam 2: Using Data

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

What is an escape sequence and why would a Java programmer use it to store a character?

(Essay)
4.9/5
(42)

final int COSTPERITEM = 10; double sales2012 = amtSold * COSTPERITEM; In the above statements, identify the named constant and describe how a programmer can recognize named constants.

(Essay)
4.8/5
(40)

What is the value of result after the following statement is executed? int result = 2 + 3 * 4;

(Multiple Choice)
4.8/5
(36)

You use the ____ data type to hold any single character.

(Multiple Choice)
4.8/5
(34)

public class YourGrade {     public static void main(String[] args)     {        int projectPoints = 89;        System.out.print("Your grade for this class is ");        System.out.print(projectPoints);        System.out.println("%");      } } Given the above code, what will be the output at the command prompt?

(Essay)
4.8/5
(39)

Which of the following is NOT a component of a variable declaration statement?

(Multiple Choice)
4.8/5
(40)

The percent sign is the ____ operator.

(Multiple Choice)
4.8/5
(41)

How would you ask the user to confirm an action using a dialog box?

(Essay)
4.9/5
(33)
Match each term with the correct statement below.
Premises:
Converts nonconforming types to the unifying type
Responses:
promotion
escape sequence
garbage value.
Correct Answer:
Verified
Premises:
Responses:
Converts nonconforming types to the unifying type
promotion
(Matching)
4.9/5
(41)
Match each term with the correct statement below.
Premises:
Begins with a backslash followed by a character
Responses:
keyboard buffer
boolean
blank final
Correct Answer:
Verified
Premises:
Responses:
Begins with a backslash followed by a character
keyboard buffer
(Matching)
4.8/5
(35)

Write the statement to declare an uninitialized integer value for salesAmt . Then write the statement to declare a constant named SALESAMT with a value of 20.99.

(Essay)
4.8/5
(36)

Write the statement that will declare and assign two integer variables, salesAmt and costAmt , in a single statement. Assign values of your choice to the variables.

(Short Answer)
4.9/5
(38)

A(n) ____ dialog box typically displays the options Yes, No, and Cancel.

(Multiple Choice)
4.8/5
(36)

The characters ____ move the cursor to the next line when used within a println() statement.

(Multiple Choice)
4.9/5
(38)

You are limited to declaring a maximum of three variables in a single statement.

(True/False)
4.9/5
(31)

The Scanner class contains methods that retrieve values called ____.

(Multiple Choice)
4.7/5
(28)

You can create a confirm dialog box with five arguments.

(True/False)
4.9/5
(36)

A(n) ____ dialog box asks a question and provides a text field in which the user can enter a response.

(Multiple Choice)
4.9/5
(39)

Even if a statement occupies multiple lines, the statement is not complete until the semicolon is reached.

(True/False)
4.8/5
(39)

Primitive types serve as the building blocks for more complex data types, called ____ types.

(Multiple Choice)
4.8/5
(39)
Showing 41 - 60 of 81
close modal

Filters

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