5-1-1: What is the value of grade when the following code executes and score is 93?
if (score >= 90)
grade = "A";
if (score >= 80)
grade = "B";
if (score >= 70)
grade = "C";
if (score >= 60)
grade = "D";
else
grade = "E";
AP CSA Semester 1 Review (Mod 1 - 5)
Quiz
•
Computers
•
10th - 12th Grade
•
Medium
Devon Senneseth
Used 16+ times
FREE Resource
77 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
5-1-1: What is the value of grade when the following code executes and score is 93?
if (score >= 90)
grade = "A";
if (score >= 80)
grade = "B";
if (score >= 70)
grade = "C";
if (score >= 60)
grade = "D";
else
grade = "E";
A
B
C
D
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What does the following code print when x has been set to -5?
if (x < 0)
System.out.println("x is negative");
else if (x == 0)
System.out.println("x is zero");
else
System.out.println("x is positive");
x is negative
x is zero
x is positive
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What does the following code print when x has been set to .8?
if (x < .25)
System.out.println("first quartile");
else if (x < .5)
System.out.println("second quartile");
else if (x < .75)
System.out.println("third quartile");
else
System.out.println("fourth quartile");
first quartile
second quartile
third quartile
fourth quartile
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is printed when the following code executes and x has been set to zero?
if (x > 0 && (y / x) == 3)
System.out.println("first case");
else
System.out.println("second case");
first case
second case
You will get a error because you can't divide by zero.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is printed when the following code executes and x has been set to negative 1?
String message = "help";
if (x >= 0 && message.substring(x).equals("help") System.out.println("first case");
else
System.out.println("second case");
first case
second case
You will get a error because you can't use a negative index with substring.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is printed when the following code executes and x has been set to zero and y is set to 3?
if ((y / x) == 3 || x = 0)
System.out.println("first case");
else
System.out.println("second case");
first case
second case
You will get a error because you can't divide by zero.
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is printed when the following code executes and x equals 4 and y equals 3?
if (!(x < 3 || y > 2))
System.out.println("first case");
else
System.out.println("second case");
first case
second case
72 questions
7-кл, Python тілінде алгоритмдерді программалау
Quiz
•
11th Grade
72 questions
Python Basics
Quiz
•
9th - 12th Grade
73 questions
LS 6: COMPUTER CITIZENSHIP
Quiz
•
10th Grade
75 questions
Trắc nghiệm Tin Học 10 Giữa kì 2
Quiz
•
10th Grade
76 questions
Digital Documentation ( X CBSE)
Quiz
•
10th Grade
80 questions
KELAS 2-LATIHAN SOAL SAT INFORMATIKA SM2
Quiz
•
2nd Grade - University
79 questions
Electronic spreadsheet (Advanced)
Quiz
•
10th Grade
77 questions
Pemrograman Web Dinamis
Quiz
•
9th - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University