Java Programming Quiz 2-6
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Fernando Nunez
Used 2+ times
FREE Resource
Enhance your content in a minute
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following formats the output to three digits after the decimal point?
System.out.printf("%.3f", 10.0 / 3.0);
System.out.println(%.3f, 10.0 / 3.0);
System.out.printf(%3f, 10.0 / 3.0);
System.out.printf(.3, 10.0 / 3.0);
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If x= 14 and y= 3, what will the output of the following code be?
int output= x%y;
System.out.println("Output: " +output);
2
4
4.6667
46.67
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements best reads in a user input of 5 if the value is to be treated as an integer?
int userNum = scnr.nextInt();
int userNum = scnr.nextInteger();
double userNum = scnr.next();
int userNum = scnr.nextLine();
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which is the correct way to read in the user's name using the Scanner class?
String name = scnr.next();
String name = scnr.nextString();
String name = scnr.NextString();
Char name = scnr.nextChar();
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
The following line of code is a valid expression. (assume that w, x, y, and z are all variables that have been declared as integers)
result = (wx) + 2y + z - 5;
True
False
True
False
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following values could be stored as boolean?
true/false
f
3
no
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
2.25
10.0
3.3
3.0
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
50 questions
Cyber Quiz
Quiz
•
University
50 questions
Quiz Python
Quiz
•
University
55 questions
SAINS KOMPUTER TINGKATAN 4
Quiz
•
12th Grade - University
50 questions
DG Muda (2)
Quiz
•
KG - Professional Dev...
47 questions
Networking - Practice Test #1
Quiz
•
9th Grade - University
53 questions
UTS Struktur Data
Quiz
•
University
50 questions
Grade 5 IT Quiz
Quiz
•
5th Grade - University
50 questions
Test 1 - SDT 2113
Quiz
•
University
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
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University
20 questions
SER vs ESTAR
Quiz
•
7th Grade - University
