Which of the following is true about comments in code?

Programming Concepts Quiz

Quiz
•
Computers
•
9th Grade
•
Medium
PATRICIA LAMMERT
Used 3+ times
FREE Resource
38 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Every function should have a comment
Comments are not necessary for any code
Comments are only needed for complex code
Every line of code must have a comment
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a precondition in the context of a function?
The function's parameters
What is true about the world before the function is called
What is true about the world after the function is called
The function's return value
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about postconditions?
They describe the initial state of the world
They describe the function's parameters
They describe the state of the world after the function is called
They are irrelevant to function execution
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In programming, what must be true before a function is executed?
The postcondition
The function's name
The function's output
The precondition
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of defining preconditions and postconditions?
To determine the function's name
To define the function's parameters
To describe the state of the world before and after the function is called
To calculate the function's execution time
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is equivalent to writing 'move();' five times?
for(var i = 0; i < 5; i++) { move(); }
for(var i = 0; i < 4; i++) { move(); }
for(var i = 1; i < 5; i++) { move(); }
for(var i = 1; i <= 5; i++) { move(); }
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main advantage of using a for loop over writing repetitive code manually?
It reduces the amount of code written
It increases the complexity
It makes the code run faster
It makes debugging harder
Create a free account and access millions of resources
Similar Resources on Quizizz
35 questions
Unit 1-4 Review

Quiz
•
9th - 12th Grade
40 questions
Robotics Final Study Guide

Quiz
•
9th - 12th Grade
35 questions
Unit 8 Test Practice

Quiz
•
9th Grade
40 questions
AP CSP Code.org Unit 5 Assessment 1 Review

Quiz
•
9th - 12th Grade
34 questions
Programming Fundamentals Quiz

Quiz
•
9th Grade
40 questions
Python Revision Years 8&9 IGCSE

Quiz
•
9th - 12th Grade
40 questions
Python - Lists, Dictionaries and Loops

Quiz
•
9th - 12th Grade
40 questions
Scratch Exam

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade
20 questions
Understanding Linear Equations and Slopes

Quiz
•
9th - 12th Grade