Casting in Java
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Patrick Bryar
Used 8+ times
FREE Resource
Enhance your content in a minute
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?
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?
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?
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?
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
12 questions
1.2.4. Types of Programming Language
Quiz
•
12th Grade
11 questions
Programming basics
Quiz
•
10th - 11th Grade
13 questions
LENGUAJE C
Quiz
•
11th Grade
11 questions
Programming Quiz 1
Quiz
•
11th Grade
15 questions
Security
Quiz
•
9th Grade
15 questions
Computer Software Quiz
Quiz
•
10th Grade
15 questions
Smartphone - 1
Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
