Search Header Logo

APCSA Barrons Practice exam 2

Computers

12th Grade - University

Used 80+ times

APCSA Barrons Practice exam 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

A large java program was tested extensively, and no errors were found. What can be concluded?

All of the preconditions in the program are correct

All of the postconditions in the program are correct

the program may have bugs

the program has no bugs

every method in the program may safely be used in other programs

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Refer to the incrementWage method. Which of the following is a correct /*implementation of incrementWage*/?

return hourlyWage + amt;

return getHourlyWage() + amt;

hourlywage += amt;

getHourlyWage() += amt;

hourlyWage = amt;

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Consider the method changeUnionStatus. Which is a correct /*implementation of changeUnionStatus*/?

I only

II only

III only

I and II only

I, II, and III only

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

A client method computePay will return a worker’s pay based on the number of hours worked.


Which replacement for /* code*/ is correct?

return hourlyWage * hours;

return getHourlyWage()*hours

return w.getHourlyWage () * hours;

return w.hourlyWage * hours;

return w.getHourlyWage() * w.hours;

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Consider this program segment. You may assume that word List has been declared as ArrayList<String>.

What is the maximum number of times that SHORT WORD can be printed?

3

4

wordList.size()

wordList.size() -1

s.length()

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Refer to the following method.

What value does mystery(4) return?

3

9

12

27

81

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Refer to the following declarations:


Which of the following correctly assigns the elements of the colors array to colorList? The final ordering of colors in colorList should be the same as in the colors array.

I only

II only

III only

II and III only

I,II, and III

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?