Exam 2: Using Data

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

Describe the error message that will be produced when the following code is compiled. public class SalesOct { public static void main(String[] args) { int salesAmt; System.out.print("October sales are $"); System.out.println(salesAmt); } }

(Essay)
4.9/5
(73)

public class EndValue { public static void main(String[] args) { int aByte = 940; System.out.print("The ending value is "+ aByte); } } When the above code is compiled, what error message will be generated and why?

(Essay)
4.9/5
(72)

char aCharacter = 2; int aNumber = '2'; In the above statements, what values will be output after a println() statement is executed? Why are the output results different for the two statements?

(Essay)
4.7/5
(70)

When you write programs that accept ____________________, there is a risk that the user will enter the wrong type of data.

(Short Answer)
4.9/5
(90)

Explain how you can override a unifying type imposed by Java.

(Essay)
4.9/5
(83)

What is the difference between the float data type and the double data type?

(Essay)
4.7/5
(70)

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

(Multiple Choice)
4.9/5
(80)

Describe how to assign values based on the result of comparisons to Boolean variables.

(Essay)
4.7/5
(94)

Why is the following relational operator expression invalid? How could you rewrite the statement so that it is valid? boolean isGradePassing = (grade => 70);

(Essay)
4.9/5
(76)

The term ____ refers to the mathematical accuracy of a value.

(Multiple Choice)
4.8/5
(75)

How could you alter the following statement to display "Welcome" on one line and "back" on another line? System.out.println("Welcome back");

(Essay)
4.9/5
(70)

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

(True/False)
4.8/5
(79)

A(n) ____________________ number contains decimal positions.

(Short Answer)
4.9/5
(85)

Describe three ways in which a constant differs from a variable.

(Essay)
4.7/5
(79)

A variable can hold more than one value at a time.

(True/False)
4.9/5
(82)

In Java, ____ is a built-in class that provides you with the means for storing and manipulating character strings.

(Multiple Choice)
4.9/5
(81)

The term parse means to break into component parts.

(True/False)
4.9/5
(92)

Write the statement to declare an uninitialized integer value for salesAmt.

(Essay)
4.7/5
(78)

MATCHING Match each term with the correct statement below. -A floating-point data type

(Multiple Choice)
4.9/5
(76)

MATCHING Match each term with the correct statement below. -The operator that is represented by an equal sign (=)

(Multiple Choice)
4.9/5
(74)
Showing 41 - 60 of 74
close modal

Filters

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