Professional Documents
Culture Documents
AP Computer Science A Sample Multiple-Choice Questions
AP Computer Science A Sample Multiple-Choice Questions
The materials included in these files are intended for noncommercial use by AP teachers for course and exam
preparation; permission for any other use must be sought
from the Advanced Placement Program. Teachers may
reproduce them, in whole or in part, in limited quantities, for
face-to-face teaching purposes but may not mass distribute
the materials, electronically or otherwise. These materials
and any copies made of them may not be resold, and the
copyright notices must be retained as they appear here.
This permission does not apply to any third-party copyrights
contained herein.
Copyright 2001 by College Entrance Examination Board. All rights reserved. College Board,
Advanced Placement Program, AP, and the acorn logo are registered trademarks of the College
Entrance Examination Board.
1.
AP Computer Science A
2
2
6
6
8
3
8
3
8
3
(D) sum = 0;
while (num >= 0)
{
num--;
sum += 5 * num;
}
(E) sum = 0;
while (num > 0)
{
sum += 5 * num;
num--;
}
(C) sum = 0;
while (num > 0)
{
num--;
sum += 5 * num;
}
AP Computer Science A
3.
I only
II only
III only
I and II only
I, II, and III
AP Computer Science A
4.
0 27
1 3 9 27
3 9 27
27 0
27 9 3
AP Computer Science A
5.
AP Computer Science A
ha
ha ha
ha ha ha
ha ha ha ha ha ha
Nothing will be output because a runtime error will occur.
AP Computer Science A
AP Computer Science A
AP Computer Science A
(A)
(B)
(C)
(D)
(E)
Case 1
Case 2
Case 3
1,000
1,000
1,000
1,000
500
1,000
11
11
500
500
1,000
11
1,000
500
500
*11. The expression !((x > y) && (y <= 3)) is equivalent to which
of the following?
(A)
(B)
(C)
(D)
(E)
(x
(x
(x
(x
(x
3)
3)
3)
3)
3)
AP Computer Science A
AP Computer Science A
10
11
A[k]
A[k]
A[k]
A[k]
A[k]
<
<
<
>
>
minIndex
A[minIndex]
A[minIndex]
minIndex
A[minIndex]
<statement>
minIndex
minIndex
minIndex
minIndex
minIndex
=
=
=
=
=
A[k];
A[minIndex];
k;
A[k];
k;
AP Computer Science A
AP Computer Science A
12
I only
II only
III only
I and II only
I, II, and III
AP Computer Science A
16.
AP Computer Science A
14
0
1
MAXITEMS - 1
MAXITEMS
MAXITEMS * 2
{
int j, k;
<body of Unique>
}
15
AP Computer Science A
I only
II only
I and II only
I and III only
I, II, and III
AP Computer Science A
16