0% found this document useful (0 votes)
10 views7 pages

A+ Sample Review

The document contains sample multiple-choice questions from review banks focused on data types, operators, and recursion in computer science. It highlights that the samples do not encompass all questions available in the actual banks, which typically contain over fifty questions each. The questions test knowledge on variable assignments and recursive method outputs.

Uploaded by

briansu368
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views7 pages

A+ Sample Review

The document contains sample multiple-choice questions from review banks focused on data types, operators, and recursion in computer science. It highlights that the samples do not encompass all questions available in the actual banks, which typically contain over fifty questions each. The questions test knowledge on variable assignments and recursive method outputs.

Uploaded by

briansu368
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

© A+ Computer Science – www.apluscompsci.

com

This is a sample of the types of


questions included in the
multiple-choice question
review banks.

This is a sample and does not


contain all of the questions
found in the actual banks.

Most question banks contain


over fifty questions each.

www.apluscompsci.com

© A+ Computer Science – www.apluscompsci.com


© A+ Computer Science – www.apluscompsci.com

Review1 – Data Types and Operators

MULTIPLE CHOICE

1. Which of the following could fill <*1> without causing a compile error?

<*1> x = 89;

I. int
II. byte
III. short
IV. long
V. double

a. I only d. I, II, III, and IV only


b. I and II only e. I, II, III, IV, and V
c. I, II, and IV only

2. Which of the following could fill <*1> without causing a compile error?

<*1> x = 160;

I. int
II. byte
III. short
IV. long
V. double

a. I only d. I, III, IV, and V only


b. I and II only e. I, II, III, IV, and V
c. I, II, and IV only

3. Which of the following could fill <*1> without causing a compile error?

<*1> x = 32799;

I. int
II. byte
III. short
IV. long
V. double

a. I only d. I, III, IV, and V only


b. I and II only e. I, II, IV, and V only

© A+ Computer Science – www.apluscompsci.com


© A+ Computer Science – www.apluscompsci.com

c. I, II, and IV only

4. Which of the following could fill <*1> without causing a compile error?

<*1> x = 327991L;

I. int
II. byte
III. short
IV. long
V. double

a. I only d. I, III, IV, and V only


b. I and II only e. I, II, IV, and V only
c. IV and V only

5. Which of the following could fill <*1> without causing a compile error?

<*1> x = 900.123f;

I. int
II. byte
III. float
IV. long
V. double

a. I only d. I, III, IV, and V only


b. III and V only e. I, IV, and V only
c. IV and V only

6. Which of the following could fill <*1> without causing a compile error?

<*1> x = 32799.876;

I. double
II. byte
III. float
IV. long
V. int

a. I only d. I, III, IV, and V only


b. I and II only e. I, II, IV, and V only
c. I and III only

© A+ Computer Science – www.apluscompsci.com


© A+ Computer Science – www.apluscompsci.com

7. Which of the following could fill <*1> without causing a compile error?

<*1> x = ‘A’;

I. int
II. byte
III. short
IV. long
V. double

a. I and III only d. I, III, IV, and V only


b. I and II only e. I, IV, and V only
c. I and IV only

8. Which of the following could fill <*1> without causing a compile error?

<*1> x = 9 + 5;

I. int
II. byte
III. short
IV. long
V. double

a. I and III only d. I, III, IV, and V only


b. I and II only e. I, II, III, IV, and V
c. I and IV only

9. Which of the following could fill <*1> without causing a compile error?

<*1> x = 9 / 2;

I. int
II. byte
III. short
IV. long
V. double

a. I and III only d. I, III, IV, and V only


b. I, II, and II only e. I, II, III, IV, and V
c. V only

© A+ Computer Science – www.apluscompsci.com


© A+ Computer Science – www.apluscompsci.com

Review 2 - Recursion

MULTIPLE CHOICE

1. public void f(int a, int b)


{
if (a/b != 0)
f(a/b,b);
System.out.print(a % b);
}

Given the method above, what is printed by the call f(4,2) ?

a. 221
b. 201
c. 3
d. 100
e. 101

2. public void f(int a, int b)


{
if (a/b != 0)
f(a/b,b);
System.out.print(a % b);
}

Given the method above, what is printed by the call f(5,2) ?

a. 221
b. 201
c. 3
d. 100
e. 101

3. public void f(int a, int b)


{
if (a/b != 0)
f(a/b,b);
System.out.print(a % b);
}

Given the method above, what is printed by the call f(3,7) ?

a. 221
b. 201
c. 3
d. 100
e. 101

© A+ Computer Science – www.apluscompsci.com


© A+ Computer Science – www.apluscompsci.com

4. public void f(int a, int b)


{
if (a/b != 0)
f(a/b,b);
System.out.print(a % b);
}

Given the method above, what is printed by the call f(9,3) ?

a. 221
b. 201
c. 3
d. 100
e. 101

5. public void f(int a, int b)


{
if (a/b != 0)
f(a/b,b);
System.out.print(a % b);
}

Given the method above, what is printed by the call f(25,3) ?

a. 221
b. 201
c. 3
d. 100
e. 101

6. public void f(int a, int b)


{
if (a/b != 0)
f(a/b,b);
System.out.print(a % b);
}

Given the method above, what is printed by the call f(33,4) ?

a. 221
b. 201
c. 3
d. 100
e. 101

© A+ Computer Science – www.apluscompsci.com


© A+ Computer Science – www.apluscompsci.com

This is a sample of the types of


questions included in the
multiple-choice question
review banks.

This is a sample and does not


contain all of the questions
found in the actual banks.

Most question banks contain


over fifty questions each.

www.apluscompsci.com

© A+ Computer Science – www.apluscompsci.com

You might also like