
Computer Scince Quizz - March 2025

Quiz
•
Computers
•
11th Grade
•
Medium
Himara Senaratne
Used 1+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 mins • 20 pts
A traffic light simulator uses pseudocode to determine actions based on color input. The rules are:
"Red" → "Stop", "Yellow" → "Caution", "Green" → "Go".
The function trafficLight() mistakenly returns "Go" for "Yellow" due to incorrect condition ordering.
How should the conditions be ordered to fix this?
Swap "Green" and "Red" checks
Place "Yellow" first
Replace ELSEIF with CASE
No changes needed
Answer explanation
The current order checks "Green" before "Yellow," causing incorrect returns. Reordering ensures correct priority.
Therefore teh answer is "Place "Yellow" first"
2.
MULTIPLE CHOICE QUESTION
10 mins • 20 pts
A developer is writing a function to check whether a given string consists only of numeric digits.
What method should they use to verify each character is a number?
Checking ASCII values
Using regular expressions
Checking character properties
Using a loop to compare each character manually
Answer explanation
ASCII values for digits range from 48 ('0') to 57 ('9'). By iterating through each character and ensuring its ASCII value falls within this range, we can validate that the string contains only numeric digits.
3.
MULTIPLE CHOICE QUESTION
10 mins • 20 pts
A company is developing a program to process a list of customer orders. The program needs to iterate over each order and apply a discount if the order total exceeds a certain amount.
Which loop structure is most suitable?
While loop
Do-while loop
For loop
Recursive function
Answer explanation
A for loop is best suited when iterating through a known number of elements, such as a list of customer orders. It ensures that each order is processed sequentially without unnecessary checks.
4.
MULTIPLE CHOICE QUESTION
10 mins • 20 pts
A software engineer is developing a program that performs calculations on large datasets. Instead of rewriting the same logic multiple times, they decide to use functions.
What is the main benefit of using reusable functions?
Reduced memory usage
Increased performance
Code maintainability and reusability
Faster execution speed
Answer explanation
Functions allow code to be reused multiple times without duplication. This improves maintainability, as any changes to logic need to be updated in only one place.
Therefore the answer is :
Code maintainability and reusability
5.
MULTIPLE CHOICE QUESTION
10 mins • 20 pts
A weather application determines if it should send a rain alert based on the current precipitation percentage.
Which conditional statement should be used?
If-else statement
Switch-case statement
For loop
While loop
Answer explanation
An if-else statement is ideal for decision-making based on conditions. It allows checking if precipitation is above a certain threshold to trigger an alert.
Therefore teh answer is:
If-else statement
6.
MULTIPLE CHOICE QUESTION
10 mins • 20 pts
A software developer needs to sort a list of product prices in ascending order.
Which sorting algorithm is used?
Quick Sort
Merge Sort
Bubble Sort
Insertion Sort
Answer explanation
Bubble Sort repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. It is simple to implement but inefficient for large datasets.
7.
MULTIPLE CHOICE QUESTION
10 mins • 20 pts
A teacher wants to print every third number between 1 and 10. The pseudocode uses a FOR loop and MOD operation to identify these numbers.
Which numbers will be printed?
1, 2, 3
3, 6, 9
1, 4, 7
2, 4, 6
Answer explanation
The loop runs from 1 to 10. The MOD operation checks if each number divided by 3 leaves no remainder. Only numbers divisible by 3 (3, 6, 9) satisfy this condition. This demonstrates how MOD can select specific items in a sequence.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Python year 9

Quiz
•
8th - 11th Grade
26 questions
GDPR, Computer Misuse and Copyright Laws

Quiz
•
11th - 12th Grade
20 questions
BTEC IT Unit 1 - F - Laws

Quiz
•
10th - 12th Grade
20 questions
Legislation

Quiz
•
9th - 11th Grade
22 questions
Programming Review

Quiz
•
9th - 12th Grade
20 questions
Basic Python

Quiz
•
10th - 12th Grade
20 questions
Control Statements in Python

Quiz
•
11th Grade
25 questions
GCSE Computer Science: Programming (Python)

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade