Question Bank · Unit 1
AP® Computer Science A Using Objects and Methods Practice Questions
Work through AP Computer Science A practice questions on Using Objects and Methods, then check each answer against a worked solution.
Free · no sign-up
Open questions need no account. Sign up or log in to open the rest.
All 776
Multiple choice 681
Free response 95
Subtopic: Using Objects
Clear filter
Consider the following code segment. int val1 = 10; int val2 = 7; val1 = (val1 + val2) % (val1 - val2); val2 = 3 + val1 * val2;…
Sign up now. It's free!
See the full question with its answer and worked solution.
Assume double dnum has been correctly declared and initialized with a valid value.…
Sign up now. It's free!
See the full question with its answer and worked solution.
Which of these expressions correctly computes the positive root of a quadratic equation assuming coefficients a, b, c have…
Sign up now. It's free!
See the full question with its answer and worked solution.
The following shuffling method is used to shuffle an array arr of int values. The method assumes the existence of a swap method, where swap(arr,i,j)…
Sign up now. It's free!
See the full question with its answer and worked solution.
Consider method getCount below. public static int getCount(String s, String sub) { int count = 0; int pos = s.indexOf(sub); while (pos >= 0)…
Sign up now. It's free!
See the full question with its answer and worked solution.
This question is based on the following declarations. String strA = "CARROT", strB = "Carrot", strC = "car";…
Sign up now. It's free!
See the full question with its answer and worked solution.
A programmer has a file of names. She is designing a program that sends junk mail letters to everyone on the list. To make the letters sound personal and…
Sign up now. It's free!
See the full question with its answer and worked solution.
Refer to the nextIntInRange method below. /** Returns a random integer in the range low to high, inclusive. */ public int…
Sign up now. It's free!
See the full question with its answer and worked solution.
This question uses a password checker to report whether a given password is weak, medium, or strong. The PasswordChecker class is shown below. You will write…
Sign up now. It's free!
See the full question with its answer and worked solution.
What output is produced by the following line of…
Sign up now. It's free!
See the full question with its answer and worked solution.
Page 24 of 55
Get your FRQs graded in the Student Portal
In the Verityprep Student Portal, answer the FRQs of AP practice and past exams by typing or uploading a photo. A teacher grades them with that year's official College Board scoring guidelines and gives you an estimated 1–5 score.
Join Verityprep now
AP® and Advanced Placement® are registered trademarks of the College Board, which is not affiliated with, and does not endorse, Verityprep. Names are used for identification purposes only.