Search Header Logo

AP CSP Procedures #3

Authored by Herman Galioulline

Computers

9th - 12th Grade

Used 84+ times

AP CSP Procedures #3
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

A computer science student completes a program and asks a classmate for feedback. The classmate suggests rewriting some of the code to include more procedural abstraction. Which of the following is NOT a benefit of procedural abstraction?

Making the code more readable

Making the code run faster

Providing more opportunities for code reuse

Reducing the amount of duplicated code

2.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

A student has a data file containing 10,000 numerical values. The student is writing a program to compute the average of the numbers contained in the file. Which of the following procedures is most likely to be useful in the student’s program?

A procedure that returns the quotient when dividing one value by another

A procedure that returns the sum when adding one value to another

A procedure that returns the sum of the values in the file

A procedure that returns true if the file contains any duplicate values and returns false otherwise

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Which of the following procedures would be most useful as part of a program to determine whether a word appears in two different text files?

A procedure getWords, which takes a positive integer n and a text file as input and returns the first n words in the text file.

A procedure isFound, which takes a word and a text file as input and returns true if the word appears in the text file

A procedure textMatch, which takes two text files as input and returns true if the two text files are identical.

A procedure sameSize, which takes two text files as input and returns true if the two text files contain the same number of words.

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

A student is writing a program that is intended to replace each negative value in a particular column of a spreadsheet with the value 0. Which of the following procedures is most likely to be useful in the student’s program?

A procedure containsNegatives, which returns true if any negative values appear in the column and returns false otherwise.

A procedure countNegatives, which returns the number of negative values that appear in the column.

A procedure findNegative, which returns the row number of the first negative value that appears in the column or -1 if there are no negative values.

A procedure minimum, which returns the minimum value that appears in the column.

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

Media Image
Media Image
Media Image
Media Image

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?