AP CSP Procedures #3

AP CSP Procedures #3

9th - 12th Grade

5 Qs

quiz-placeholder

Similar activities

IP, MAC and Protocols

IP, MAC and Protocols

9th - 10th Grade

10 Qs

HTML Tags

HTML Tags

9th Grade

10 Qs

Python- Text file handling Quiz 2

Python- Text file handling Quiz 2

12th Grade

10 Qs

Adobe InDesign

Adobe InDesign

11th Grade

10 Qs

Excel If function WSC 4.2.3

Excel If function WSC 4.2.3

7th Grade - University

10 Qs

Python Basic files

Python Basic files

10th - 12th Grade

10 Qs

OCR GCSE CS MCQ2 1.5 Networks (J276)

OCR GCSE CS MCQ2 1.5 Networks (J276)

9th - 10th Grade

10 Qs

File Handling

File Handling

12th Grade

10 Qs

AP CSP Procedures #3

AP CSP Procedures #3

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Herman Galioulline

Used 77+ times

FREE Resource

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