Exam 1: Getting Started

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

How is the % modulus)operator used? What is the common use of the modulus operator?

Free
(Essay)
4.9/5
(39)
Correct Answer:
Verified

The modulus operator is used to return the remainder in integer division.For example,the modulus operator is commonly used to determine if a number is an even or an odd value.

Java is an interpreted language.

Free
(True/False)
4.9/5
(37)
Correct Answer:
Verified

True

What is the value of the variable amountDue? double price = 2.50; Double quantity = 5; Double amountDue = 0; AmountDue = price * quantity;

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

C

The value of the expression int)27.6 evaluates to:

(Multiple Choice)
4.8/5
(43)

An advantage of using the Unicode character set is that it easily handles languages other than English.

(True/False)
4.8/5
(42)

Why is using named constants a good programming practice?

(Essay)
4.9/5
(26)

In Java,the equal sign is used as the ___________ operator.

(Multiple Choice)
4.8/5
(40)

What is the value of the variable c in the statements that follow? String phrase = "Make hay while the sun is shining."; Char c = phrase.charAt10);

(Multiple Choice)
4.9/5
(46)

The result of integer division is truncated in Java.

(True/False)
4.8/5
(31)

Identify the invalid Java identifier.

(Multiple Choice)
4.7/5
(41)

Write a Java statement to access the 7< sup >th< /sup > character in the String variable myString and place it in the char variable c.

(Essay)
4.8/5
(33)

List the primitive data types Java supports.Indicate the kind of values each type can store.

(Essay)
4.8/5
(35)

What is the syntax and semantics of a programming language?

(Essay)
4.7/5
(38)

What is the output of the following Java statements? //String method examples String str = "Java Programming!"; System.out.printlnstr.equals"Java Programming!")); System.out.printlnstr.toLowerCase)); System.out.printlnstr.toUpperCase)); System.out.printlnstr.substring5,8)); System.out.printlnstr.lastIndexOf"m"));

(Essay)
4.8/5
(37)

Java does not require that a variable be declared before it is used within a program.

(True/False)
4.8/5
(41)

Applets were designed to run as stand-alone applications.

(True/False)
4.8/5
(45)

In Java,source code is compiled into object code called ______________.

(Multiple Choice)
4.8/5
(34)

What is the value of 7.52e-5?

(Multiple Choice)
4.9/5
(38)

What is the output produced by the following lines of code? int value1 = 3; int value2 = 4; int result = 0; result = value1++ * value2--; System.out.println"Post increment/decrement: " + result); result = ++value1 * --value2; System.out.println"Pre increment/decrement: " + result);

(Essay)
4.8/5
(40)

How are line comments and block comments used?

(Essay)
4.7/5
(36)
Showing 1 - 20 of 45
close modal

Filters

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