WorksheetsFunctions and Comments Quiz
Total questions: 15
Worksheet time: 8mins
Name
Class
Date
1.
What is the primary purpose of creating functions in programming?
a)
To make code longer and more complicated
b)
To make code shorter and more readable
c)
To create unnecessary complexity
d)
To slow down program execution
2.
What does the term 'debugging' specifically refer to in computer programming?
a)
Designing computer hardware
b)
Writing new computer programs
c)
Creating complex algorithms
d)
Finding and fixing errors in a program
3.
When defining a function, what do arguments represent?
a)
Numbers or objects passed to the function
b)
The function's name
c)
Comments in the code
d)
The total lines of code
4.
Which of the following is NOT a reason for using functions in programming?
a)
Making code more readable
b)
Allowing team members to split work
c)
Simplifying code modifications
d)
Creating random code sequences
5.
What is the primary purpose of using a function in programming?
a)
To slow down the computer's processing
b)
To create random computer sounds
c)
To make code look more complicated
d)
To allow code reuse and reduce repetition
6.
What does 'pseudo-code' literally mean in programming?
a)
Serious programming code
b)
Perfect computer language
c)
Fake or bogus code
d)
Advanced mathematical notation
7.
In the context of the lesson, how is a function similar to a loop?
a)
Both only work in math problems
b)
Both help repeat similar patterns of code
c)
Both are used to create random numbers
d)
Neither have any similarities
8.
What is the primary goal of debugging in programming?
a)
To make code look prettier
b)
To identify and fix errors in a program
c)
To slow down computer processing
d)
To create more complicated code
9.
What does 'iteration' mean in programming?
a)
Writing code only once
b)
Repeating a set of actions on each element of a collection
c)
Creating a single computer instruction
d)
Stopping a computer program
10.
What happens when a function is 'called' in a program?
a)
The function is permanently deleted
b)
The set of instructions in the function are executed
c)
The program creates a new variable
d)
The computer immediately stops running
11.
What is the primary purpose of a function in coding?
a)
To make the computer run slower
b)
To perform a specific task or set of instructions
c)
To stop the program from running
d)
To create random decorations on the screen
12.
In the syntax of a CoffeeScript function, what does the parameter represent?
a)
A placeholder for a value that can be passed to the function
b)
A comment explaining the function
c)
The final output of the function
d)
The name of the function itself
13.
What is the key difference between an in-built function and a user-defined function?
a)
In-built functions come with the system, while user-defined functions are created by the programmer
b)
In-built functions can only be used once
c)
In-built functions are always longer
d)
User-defined functions are always more complex
14.
What symbol is used to create a comment in CoffeeScript?
a)
#
b)
/*
c)
&&
d)
//
15.
When you 'call' a function, what are you doing?
a)
Creating a new function
b)
Renaming the function
c)
Executing the function's set of instructions
d)
Deleting the function
100 %
