WorksheetsITC 112 - Topic 3 Quiz
Total questions: 55
Worksheet time: 28mins
The programmer wants to display the result of an equation immediately after getting the inputs.
Sequence
Selection
Repetition
The code executes step-by-step without any conditions or loops.
Sequence
Selection
Repetition
The program calculates the area of a rectangle after reading length and width.
Sequence
Selection
Repetition
The student wrote a code that adds two numbers, then prints the total.
Sequence
Selection
Repetition
A beginner programmer is learning to run statements one after another in the exact order they appear.
Sequence
Selection
Repetition
The programmer wants the program to decide whether a student passes or fails based on an average grade.
Sequence
Selection
Repetition
The code must choose which discount to apply depending on the total purchase amount.
Sequence
Selection
Repetition
The program displays a different message depending on the user’s gender input (M or F).
Sequence
Selection
Repetition
The system needs to determine which day of the week to print based on a user’s choice number (1–7).
Sequence
Selection
Repetition
A programmer needs to check several conditions to pick the best output — for example, which of three numbers is largest.
Sequence
Selection
Repetition
The program asks the user to enter a password until the correct one is typed.
Sequence
Selection
Repetition
The programmer wants to calculate the running total of sales until the user enters “0.”
Sequence
Selection
Repetition
The system prints numbers from 1 to 10 automatically.
Sequence
Selection
Repetition
A programmer wants to make the computer continue showing a menu until the user chooses “Exit.”
Sequence
Selection
Repetition
The code needs to keep checking sensor data until the temperature goes below 30°C.
Sequence
Selection
Repetition
The program should check if a student qualifies for honors; if the average is ≥ 90, display “With Honors.”
One Way Selection
If Else Block
Switch
The programmer wants to execute a statement only when the entered number is positive.
One Way Selection
If Else Block
Switch
The system must display “Access Granted” only when the password is correct.
One Way Selection
If Else Block
Switch
The code needs to add a bonus to salary only if the employee has perfect attendance.
One Way Selection
If Else Block
Switch
The program prints “Low Battery” when the power level drops below 20%.
One Way Selection
If Else Block
Switch
The program decides whether a student passes or fails based on an input grade.
One Way Selection
If Else Block
Switch
The ATM system checks if the withdrawal amount is available: dispense cash if enough, otherwise show “Insufficient Funds.”
One Way Selection
If Else Block
Switch
The code should display “Even Number” when divisible by 2, and “Odd Number” otherwise.
One Way Selection
If Else Block
Switch
The program determines whether the entered temperature means “Hot” or “Cold.”
One Way Selection
If Else Block
Switch
The system must show “Login Successful” for correct credentials and “Invalid Login” for wrong ones.
One Way Selection
If Else Block
Switch
The programmer wants the program to choose among several grade remarks:
90–100 → Excellent, 80–89 → Very Good, 70–79 → Good, Below 70 → Fail.
One Way Selection
If Else Block
Switch
The vending machine should show the selected item based on number (1 for Water, 2 for Juice, 3 for Soda).
One Way Selection
If Else Block
Switch
The traffic-light program must display “Go,” “Ready,” or “Stop” depending on a color input.
One Way Selection
If Else Block
Switch
A menu-driven program offers multiple options: Add, Edit, Delete, Exit. Each option performs a different action.
One Way Selection
If Else Block
Switch
The grading system displays “A,” “B,” “C,” “D,” or “F” depending on the numeric score range.
One Way Selection
If Else Block
Switch
The program should repeatedly ask the user to enter a correct password until it matches the stored one.
While Loop
Do While Loop
For Loop
A sensor keeps checking the room temperature every second until it is above 25 °C.
While Loop
Do While Loop
For Loop
The code continues to read data from a file as long as there are still records remaining.
While Loop
Do While Loop
For Loop
The system must display the menu again and again unless the user has not selected “Exit.”
While Loop
Do While Loop
For Loop
The program computes interest repeatedly until the balance is greater than zero.
While Loop
Do While Loop
For Loop
The program must execute a calculation at least once, even if the condition becomes false afterwards.
While Loop
Do While Loop
For Loop
The system asks, “Do you want to continue?” and repeats the process based on the user’s response.
While Loop
Do While Loop
For Loop
The code displays a set of quiz questions, then asks at the end if the user wants to try again.
While Loop
Do While Loop
For Loop
A simple guessing game runs once and keeps looping after each wrong answer, until the correct guess is entered.
While Loop
Do While Loop
For Loop
The program shows the transaction summary first, then asks if the user wants another transaction.
While Loop
Do While Loop
For Loop
The programmer wants to print numbers 1 to 100 automatically without user input.
While Loop
Do While Loop
For Loop
The code should add the first 10 natural numbers and display their sum.
While Loop
Do While Loop
For Loop
The program must display the multiplication table of 5 (from 1 to 10).
While Loop
Do While Loop
For Loop
A loop executes a fixed number of times to compute grades for 30 students in a class.
While Loop
Do While Loop
For Loop
The system repeats a set of tasks exactly 5 times before stopping.
While Loop
Do While Loop
For Loop
The program checks if the user’s entered PIN is exactly the same as the stored PIN.
==
!=
>
<
<=
The system must display “Invalid input” when the entered age is not equal to a required value.
==
!=
>
<
<=
The code needs to determine if a student’s grade is higher than 90 to qualify for honors.
==
!=
>
<
<=
A loop continues while the entered number is not more than 100.
==
!=
>
<
<=
The program should only allow access if the number of attempts is smaller or the same as 3.
==
!=
>
<
<=
The program grants login access only if the username and password are both correct.
&&
||
!
The system displays “Discount Applied” when the user is a member or has a coupon.
&&
||
!
The machine continues operation only if the power is ON and the emergency stop is OFF.
&&
||
!
The program displays “Access Denied” when the input password is not equal to the stored password.
&&
||
!
The vending machine dispenses a product if payment is complete or a promo code is entered.
&&
||
!
