
Grade 12 Computer Science Quiz
Authored by Tanay Jagnani
Computers
12th Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a variable and a constant in programming?
A variable and a constant are the same thing
A variable can change its value, while a constant cannot be changed.
A variable is used for text data, while a constant is used for numerical data
A constant can change its value, while a variable cannot be changed
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the concept of data types and provide examples of different data types used in programming.
Data types in programming are not important and can be ignored
Examples of data types include colors, shapes, and sizes
Data types are only used in hardware, not in programming
Data types in programming refer to the classification of different types of data that can be used in a program. Examples of data types include integers, floating point numbers, characters, strings, and boolean values.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a function in programming? Provide an example of a simple function.
To slow down the program
To perform a specific task or calculation.
To make the code more confusing
To display a message to the user
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Differentiate between a function and a method in programming.
A function is used for mathematical calculations, while a method is used for printing output
A function is defined outside of a class, while a method is defined inside of a class.
A function can only be called once, while a method can be called multiple times within a program
A function is only used in object-oriented programming, while a method is used in procedural programming
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the concept of arrays and lists in programming. Provide an example of when each would be used.
Arrays and lists are interchangeable and can be used in the same scenarios.
Arrays would be used when a fixed-size collection of elements of the same data type is needed, such as storing a collection of integers. Lists would be used when a dynamic collection of elements of different data types is needed, such as managing a list of items in a shopping cart.
Arrays are used for storing characters, while lists are used for storing numbers.
Arrays are used for dynamic collections, while lists are used for fixed-size collections.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the key principles of object-oriented programming? Provide an example of a class and an object in OOP.
A class in OOP is a 'Dog' class with properties like 'color' and 'breed', and methods like 'bark' and 'fetch'
An object in OOP would be an instance of the 'Book' class, such as 'myBook' with specific values for the properties
An example of a class in OOP is a 'Car' class, which may have properties like 'make', 'model', and 'year', and methods like 'start' and 'stop'. An object in OOP would be an instance of the 'Car' class, such as 'myCar' with specific values for the properties.
A class in OOP is a 'Tree' class with properties like 'height' and 'age', and methods like 'grow' and 'shed leaves'
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are some common techniques for debugging and troubleshooting code in programming?
Using print statements, using a debugger tool, reviewing error messages, and conducting code reviews
Eating snacks while coding
Ignoring error messages and hoping the code will work
Asking a friend who is not familiar with programming for help
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?