APCSA Unit 4 test

APCSA Unit 4 test

9th Grade

35 Qs

quiz-placeholder

Similar activities

Java Practice

Java Practice

9th - 12th Grade

35 Qs

Unit 5 and 6 Test Quiz - Computer programming - java

Unit 5 and 6 Test Quiz - Computer programming - java

9th - 12th Grade

30 Qs

Greenfoot Vocabulary

Greenfoot Vocabulary

9th - 12th Grade

30 Qs

Strings In java

Strings In java

9th - 10th Grade

35 Qs

Arrays, Arraylists, 2D Arrays

Arrays, Arraylists, 2D Arrays

9th - 12th Grade

35 Qs

CodeHS Unit 3 Methods Practice

CodeHS Unit 3 Methods Practice

9th - 12th Grade

40 Qs

Project STEM AP CS A Unit 1

Project STEM AP CS A Unit 1

9th - 12th Grade

34 Qs

AP Java Exam

AP Java Exam

8th Grade - University

35 Qs

APCSA Unit 4 test

APCSA Unit 4 test

Assessment

Quiz

Computers

9th Grade

Hard

Created by

Thomas Wright

Used 16+ times

FREE Resource

35 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a method that loops until the user inputs the correct secret password or until the user fails to enter the correct password 10 times. The secret password the program should look for is the String "secret"

Assume that a Scanner object called input has been correctly initialized.

Media Image
Media Image
Media Image
Media Image

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What would the method call myMethod("Karel The Dog", 'e') return?

1

2

3

4

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What kind of error would the method call myMethod("Frog") cause?

Compile Time Error: String index out of range

Runtime Error: String index out of range

Compile Time Error: Unexpected return value

Runtime Error: Syntax Error in method definition

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the call to the method funWithNumbers(314159) print to the screen?

314159

951413

314

951

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the call to the method someMethod(3,1) output?

9

12

11

10

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a method that will ask for user input until user inputs the String “no”. Allow the user to input any capitalization of the String “no” (“no”, “No”, “NO”, “nO”) Also, have the method return the number of loops.

Assume that a Scanner object input has already been created.

Media Image
Media Image
Media Image
Media Image

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the call to method patternGrid(3,4,'#') print?

####

####

####

###

###

###

####

####

####

####

This code will error.

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?