wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Comments documentation coding

Total questions: 8

Worksheet time: 5mins

Name
Class
Date
1.

// Why add comments to code?

// more than one is true!

a)

retain the code tips for yourself

b)

explain code to others

c)

disable code for a moment of problem solving

d)

All true:

2.

Syntax: Leave a comment in code by starting the line with _____

a)

//

b)

blanks

c)

indent

d)

$

3.

Programmers use comments to:

a)

debug issues in code

b)

document how code was written for other programmers to use

c)

decide which components are important to use

4.

An advantage to using comments in your code is:

a)

It makes your code run better

b)

It runs the code in slow motion, step by step

c)

it describes parts of your code so others can understand it or improve it

d)

comments are necessary in order to call a function

5.
When creating a program, how does the use of comments help a computer scientist debug problems?
a)

Comments show the exact location of bugs.

b)

Comments are optional

c)

Comments can disable code temporarily.

d)

// comment

var x = 0;

6.

Form of program documentation written into the program to be read by people.

a)

Comment

b)

Documentation

c)

Input

d)

Output

7.

What did the grey hair person put in their code?
This explains the finished project.
The answer is: comments

(a)  

8.

Giving variables clear names creates code that documents what is happening and helps other programmers understand your code

a)

False

b)

True

c)

Decoy
do not click me