?

AP® Computer Science Principles

Free Version

Upgrade subject to access all content

Easy

Readability

APCSP-CLEKWK

Mohamed notices that the same six lines of code appear in his program in multiple places. He writes a procedure that does these six lines of codes, then replaces them in the program with a call to the procedure.

Why will this help Mohamed reason through his program later?

Select TWO answers.

A

The procedure makes those six lines more abstract, so he doesn’t have to think through them each time he comes to them in the code.

B

The separate procedure will make the program more efficient, spending less time doing the same six lines over and over again.

C

If there’s an error in the procedure, he can fix the error in the procedure without having to search through his code for each place the procedure is used.

D

He will have less code to document, making his program less cluttered and easier to read.