int x = 5;
double y = x;
What is the value of y?
Units 1 to 6: Mock Exam Final - AP Computer Science A

Flashcard
•
Quizizz Content
•
Computers
•
9th - 12th Grade
•
1 plays
•
Hard
Student preview

28 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
5.0
2.
FLASHCARD QUESTION
Front
Which is a valid Java boolean expression? Options: true && 5, false == 1, 7 > 3, 3 + 5
Back
7 > 3
3.
FLASHCARD QUESTION
Front
Which code snippet correctly casts a double to an int? Options: int a = 7.2; int a = (int)7.2; int a = double(7.2); int a = toInt(7.2);
Back
int a = (int)7.2;
4.
FLASHCARD QUESTION
Front
If myFlag is a boolean variable, which assignment is valid? myFlag = "true"; myFlag = 1; myFlag = (boolean) 1; myFlag = true;
Back
myFlag = true;
5.
FLASHCARD QUESTION
Front
Which condition will check if a number x is between 10 and 20 (inclusive)? Options: (x > 10 && x < 20), (x >= 10 && x <= 20), (x == 10 || x == 20), (10 < x && x < 20)
Back
(x >= 10 && x <= 20)
6.
FLASHCARD QUESTION
Front
Which of the following code segments, when placed in a method in a class other than WindTurbine, will construct a WindTurbine object wt with an efficiencyRating of 0.25? Options: WindTurbine wt = new WindTurbine(0.25);, WindTurbine wt = 0.25;, WindTurbine wt = new WindTurbine();
wt = 0.25;, WindTurbine wt = new WindTurbine();
wt.efficiencyRating = 0.25;, new WindTurbine wt = 0.25;
Back
WindTurbine wt = new WindTurbine(0.25);
7.
FLASHCARD QUESTION
Front
What is printed as a result of executing the following code segment?
int k = 1; while (k < 20) { if ((k % 3) == 1) System.out.print(k + " "); k++; }
Back
1 4 7 10 13 16 19
Explore all questions with a free account
Similar Resources on Quizizz
20 questions
CodeHS Python Unit 3 Flashcard Review

Flashcard
•
9th - 12th Grade
25 questions
MW CodeHS Basic Java Review for test

Flashcard
•
8th - 12th Grade
23 questions
AP CSA Unit One Review

Flashcard
•
11th Grade
21 questions
AP CSP Unit 7: Parameters, Returns, and Libraries

Flashcard
•
9th - 12th Grade
21 questions
Java Loops

Flashcard
•
KG
18 questions
AP CSA Unit 1 Review

Flashcard
•
10th - 12th Grade
23 questions
Java Loops

Flashcard
•
10th - 12th Grade
21 questions
C.P. - Flashcard #2 - Review

Flashcard
•
9th - 12th Grade
Popular Resources on Quizizz
39 questions
Respect and How to Show It

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
10 questions
Human Body Systems and Functions

Interactive video
•
6th - 8th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
Discover more resources for Computers
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
20 questions
Investing

Quiz
•
9th - 12th Grade
20 questions
EOC Math 1 Review

Quiz
•
9th Grade
20 questions
Insurance

Quiz
•
9th - 12th Grade
20 questions
Act 1 of Romeo and Juliet

Quiz
•
9th Grade
20 questions
Common Grammar Mistakes

Quiz
•
7th - 12th Grade
20 questions
Paying for College

Quiz
•
9th - 12th Grade