
unit 3 practice question set 8

Quiz
•
Computers
•
9th - 12th Grade
•
Easy
Caleb Kim
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the output of the below code?
public class TestClass
{
public static void main(String[] args)
{
int x =2;
int y =3;
System.out.println(x + " + "+ y + " = " +adder(y,x));
}
public static int adder(int x, int y)
{
return x+y;
}
}
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the output of the below code?
public class TestClass
{
public static void main(String[] args)
{
int x =2;
int y =3;
int answer = subtracter(x,y);
System.out.println(x + " - "+ y + " = " +answer);
}
public static int subtracter(int x, int y)
{
return x-y;
}
}
3.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the output of the below code?
public class TestClass
{
public static void main(String[] args)
{
int x =2;
int y =3;
int answer = subtracter(y,x);
System.out.println(x + " - "+ y + " = " +answer);
}
public static int subtracter(int x, int y)
{
return x-y;
}
}
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the below code?
public class TestClass
{
public static void main(String[] args)
{
int x = 5;
int y = 2;
System.out.println(mystery(x,y));
}
public static int mystery(int x, int y)
{
return x+y;
}
public static double mystery(double x, double y)
{
return x-y;
}
public static double mystery(double x, int y)
{
return x/y;
}
public static int mystery(int a)
{
return (int)(Math.pow(a,2));
}
}
3.5
2.5
7
error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the below code?
public class TestClass
{
public static void main(String[] args)
{
int x = 5;
int y = 2;
System.out.println(mystery(x));
}
public static int mystery(int x, int y)
{
return x+y;
}
public static double mystery(double x, double y)
{
return x-y;
}
public static double mystery(double x, int y)
{
return x/y;
}
public static int mystery(int a)
{
return (int)(Math.pow(a,2));
}
}
error
25
3.5
7
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the below code?
public class TestClass
{
public static void main(String[] args)
{
double x = 5;
double y = 2;
System.out.println(mystery(x, y));
}
public static int mystery(int x, int y)
{
return x+y;
}
public static double mystery(double x, double y)
{
return x-y;
}
public static double mystery(double x, int y)
{
return x/y;
}
public static int mystery(int a)
{
return (int)(Math.pow(a,2));
}
}
error
7
2.5
3.0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the below code?
public class TestClass
{
public static void main(String[] args)
{
double x = 5;
int y = 2;
System.out.println(mystery(x,y));
}
public static int mystery(int x, int y)
{
return x+y;
}
public static double mystery(double x, double y)
{
return x-y;
}
public static double mystery(double x, int y)
{
return x/y;
}
public static int mystery(int a)
{
return (int)(Math.pow(a,2));
}
}
error
2.5
3.0
25
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
002_Java Methods

Quiz
•
12th Grade - University
13 questions
Methoden in der Programmierung

Quiz
•
11th Grade
11 questions
algoritma

Quiz
•
12th Grade
10 questions
Introduction To Java: Hello World

Quiz
•
7th - 12th Grade
15 questions
ASK T3-STRUKTUR KOD ARAHAN

Quiz
•
9th Grade
12 questions
Arrays Intro

Quiz
•
9th - 12th Grade
15 questions
Java Level 1 - D

Quiz
•
12th Grade
15 questions
C# Loops (All)

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade