Casting in Java

Casting in Java

9th - 12th Grade

11 Qs

quiz-placeholder

Similar activities

Visual Basic 2010

Visual Basic 2010

8th Grade - University

10 Qs

1.2.4. Types of Programming Language

1.2.4. Types of Programming Language

12th Grade

12 Qs

Numpy-1

Numpy-1

9th - 12th Grade

10 Qs

Test on Python Function

Test on Python Function

11th - 12th Grade

12 Qs

LENGUAJE C

LENGUAJE C

11th Grade

13 Qs

แบบฝึกหัดทบทวนบทเรียน โครงสร้างภาษาซี

แบบฝึกหัดทบทวนบทเรียน โครงสร้างภาษาซี

12th Grade

12 Qs

Administrasi Infrastruktur Jaringan

Administrasi Infrastruktur Jaringan

1st - 10th Grade

10 Qs

แบบทดสอบก่อนเรียน บทที่ 1 ตุ๊กตาแม่ลูก

แบบทดสอบก่อนเรียน บทที่ 1 ตุ๊กตาแม่ลูก

11th Grade

10 Qs

Casting in Java

Casting in Java

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Patrick Bryar

Used 8+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

int a = 15;

double b = (double) a / 2.0;

System.out.println(b);

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

7.0
7.5
8.0
15.0

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

int x = 5;

double y = (double) (x * 2);

System.out.print(x + " " + y);

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

5 10.0

5 10

10 5.0

10 5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

double num1 = 10.5;

int num2 = (int) num1;

double result = num1 - num2;

System.out.println(result);

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

0.5
10.5
10
0

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

int m = 8;

double n = (double) (m + 3) / 2;

System.out.print(m + " " + n);

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

8 5.5

8 6.0

8 5.0

11 5.5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

double x = 7.0;

int y = (int) x;

double z = x / y;

System.out.println(z);

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

1.0
7.0
0.0
None of the above

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

int a = 10;

double b = 3.0;

double c = (double) a / b;

System.out.print(a + " " + b + " " + c);

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

10 3.0 3.3333333333333335
10 3.0 3.0
10 3.0 3.33
10 3.0 3.3

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

int x = 6;

double y = (double) (x / 2);

System.out.println(x + " " + y);

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

6 3.0

6 3

3 3.0

3 3

Create a free account and access millions of resources

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?