AnswersASC Programming Games Apps and SocietyNew Data Types and the If Statement

New Data Types and the If Statement Answers

12 verified answers1 views
1
Free Preview

Match the Java term on the left with its description on the right.

Answer not available
2
Free Preview

Match the description on the left with its term on the right.

Answer not available
3

Choose the string types among these code sequences. Select all that apply.

A
String userChoice;
B
String userName;
C
public static void main(String[] someVariableName) throws IOException {
4

Complete the sentence.

Answer:

Typecasting

5

Complete the sentence.

Answer:

character

6

What statements in Java allow for complex logical decisions and processing?

A
And and not
B
If and then
C
Then and else
D
If and if-else
7

If you need to use a single character in a Java program, why is it important not to use a string literal?

A
A string literal is used to do numerical operations.
B
A string literal is used to initiate variable names.
C
A string literal classifies a Boolean value, 0 or 1.
D
A string literal stores sequences of characters.
9

If you evaluated the statements for an if-else statement in a Java program, which format would produce ‘Answer is yes’ when the variable choice = 5?

A
if (choice<3) {System.out.println (‘Answer is yes’);} else {system.out.println (‘Answer is no’);
B
if (choice>3) {System.out.println (‘Answer is no’);} else {system.out.println (‘Answer is yes’);
C
if (choice>3) {System.out.println (‘Answer is yes’);} else {system.out.println (‘Answer is no’);}
D
if (choice=3) {System.out.println (‘Answer is yes’) else {system.out.println (‘Answer is no’);}
10

Which statement is not true about the string data type in Java?

A
String assignment uses double quotes.
B
String uses less memory than char.
C
String stores sequences of characters.
D
String creates a String class object.
12

Match each word to its correct meaning.

Answer not available

Did you find these answers helpful?