Programming Concepts Quiz

Programming Concepts Quiz

9th Grade

38 Qs

quiz-placeholder

Similar activities

CS Discoveries Final Exam

CS Discoveries Final Exam

9th Grade

35 Qs

Python Programming

Python Programming

9th - 12th Grade

35 Qs

Unit 3 Functions and Parameters

Unit 3 Functions and Parameters

7th Grade - University

35 Qs

Robotics Final Exam Study Guide Part II

Robotics Final Exam Study Guide Part II

9th - 12th Grade

35 Qs

Karel Review

Karel Review

9th - 12th Grade

37 Qs

Quarter 2 Test Review

Quarter 2 Test Review

9th - 12th Grade

40 Qs

Unit 8 CodeHS Computer Science Essentials

Unit 8 CodeHS Computer Science Essentials

9th - 12th Grade

35 Qs

Study Guide for Final Exam*

Study Guide for Final Exam*

9th - 12th Grade

35 Qs

Programming Concepts Quiz

Programming Concepts Quiz

Assessment

Quiz

Computers

9th Grade

Medium

Created by

PATRICIA LAMMERT

Used 3+ times

FREE Resource

38 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about comments in code?

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?