AP Computer Science Midterm Review

AP Computer Science Midterm Review

10th - 12th Grade

26 Qs

quiz-placeholder

Similar activities

AP CSA Unit 2 Practise MCQ

AP CSA Unit 2 Practise MCQ

11th Grade

21 Qs

Networks and the Internet

Networks and the Internet

9th - 12th Grade

25 Qs

SOCIETAL IMPACT(2021-22)

SOCIETAL IMPACT(2021-22)

12th Grade

25 Qs

Practice Intro to Java Quiz Unit 1

Practice Intro to Java Quiz Unit 1

10th - 12th Grade

25 Qs

Code.org Animation and Games

Code.org Animation and Games

9th - 12th Grade

24 Qs

AP Computer Science Principles Big Idea 3

AP Computer Science Principles Big Idea 3

12th Grade

21 Qs

15 Days of Code

15 Days of Code

11th Grade - University

22 Qs

AP CSA Primitive Types Practice

AP CSA Primitive Types Practice

11th Grade

22 Qs

AP Computer Science Midterm Review

AP Computer Science Midterm Review

Assessment

Quiz

Computers

10th - 12th Grade

Hard

Created by

Bill Butterfield

Used 57+ times

FREE Resource

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
Which of the following pairs of declarations will cause an error message?
none
I only
II only
II and III only

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
What will be produced by the following statement?
I
II
III
none of these

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
The following code fragment outputs "13 / 5 = 2.0", however the programmer wanted it to output "13 / 5 = 2.6". Which of the following will NOT correct the error?
double answer = ( double ) 13 / 5;
double answer = 13 / ( double ) 5;
double answer = 13.0 / 5;
double answer = ( double ) ( 13 / 5 );

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
Expressions follow order of operations rules. What value will result hold after this statement is executed?
-5
0
13
12

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
Suppose that addition and subtraction had higher precedence than multiplication and division. What would the following expression evaluate as?
(hint: Use parentheses to elevate the rank of addition and subtraction operations)
7
8
0
1

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Assume aNum is a variable of type double that is positive. A program contains the boolean expression (Math.pow( aNum, 0.5 ) == Math.sqrt ( aNum )). Even though aNum1/2 is mathematically equivalent to √aNum the above expression returns the value false in a student's program. Which of the following is the most likely reason?
Math.pow returns an int, while Math.sqrt returns a double.
aNum was imprecisely calculated in a previous program statement.
The computer stores floating-point numbers with 32-bit words.
There is round-off error in calculating the pow and sqrt functions.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
If a is of type int and has a value of 0 when the segment is executed, what will happen?
An ArithmeticException will be thrown.
statement2, but not statement1, will be executed.
statement1, but not statement2, will be executed.
A syntax error will occur.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?