Search Header Logo

Java Basics - Day 21 SQ

Authored by Courtney Yatteau

Computers

10th - 12th Grade

Used 2+ times

Java Basics - Day 21 SQ
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When we want to print in Java, we use the code ......

system.out.print();
System.out.println();
System.Out.Printf();
System.out.show();

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A variable that holds a whole number

String
boolean
int
float

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A variable that holds words

String
boolean
int
float

4.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Suppose that addition and subtraction had higher precedence than multiplication and division. Then the expression:


2 + 3 * 12 / 7 - 4 + 8


would evaluate to which of the following?

11

12

5

9

-4

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Assume that a and b are integers. The boolean expression

!( a <= b) && (a * b > 0)

will always evaluate to true given that

a = b

a > b

a < b

a > b and b > 0

a > b and b < 0

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Consider the following code segment:

Line 1: int a = 10;

Line 2: double b = 10.7;

Line 3: double c = a + b;

Line 4: int d = a + c;

Line 5: System.out.println(c + " " + d);


What will be output as a result of executing the code segment?

20 20

20.0 30

20.7 31

20.7 30.7

Nothing will be printed because of a compile-time error.

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Consider the following code segment:


int var = 12;

var = var % 7;

var = var - 1;

System.out.println(var);


What is printed as a result of executing the code segment?

0

1

2

4

5

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?