Font size
WorksheetsTryout Bag. 4.1
Total questions: 70
Worksheet time: 55mins
In a game, a monster appears every 8 seconds. How many monsters appear in 1 minute?
6
7
8
5
Which of the following best describes “programming”?
Writing instructions for a computer to follow
Drawing instructions on a computer
Give a picture of instructions on a computers
Add instruction for a computer to follow
Which of these is NOT an example of a loop?
for i = 1, 10 do
while health > 0 do
repeat ... until score == 100
if score > 100 then
Which is the best way to reuse code?
Copy-paste it many times
Delete it
Write it in a comment
Put it inside a function
If a timer counts down from 10 to 0, it is using…
A variable
A function
A conditional statements
A loop
Which is a variable in a game?
Player’s score
Game’s background music
The color of the keyboard
The GUI
Which of the following describes a loop?
A set of instructions repeated multiple times
A single instruction
A pause in the game
A saved file
If health is set to 0, what usually happens in a game?
Player wins
Player’s character dies
Player’s score doubles
Player’s speed increases
Which logic operator means “both conditions must be true”?
OR
AND
NOT
==
What is a conditional statement used for?
To repeat a task
To make decisions
To store data
To save a file
In a game, if lives is less than 1, what should happen?
Player levels up
Game ends
Player gets extra life
Coins are doubled
Which symbol in programming means “equal to”?
==
AND
OR
NOT
If a loop runs from 1 to true, how many times will it repeat?
Error
Looping just once
What is the main purpose of a function?
To store graphics
To reuse code
To slow down the program
To stop a game
In programming, what is an algorithm?
A music beat
A step-by-step solution
A character skin
A game map
Which is an example of using an if statement?
If player’s score is 100, show “You Win!”
Display the score
Play music
Save the game
Which loop will keep running forever if there is no condition to stop it?
for
while
repeat
until
Which data type is “true” or “false”?
String
Boolean
Number
Condition Statement
What happens if you set a variable speed = speed + 1 in a loop?
Speed decreases
Speed stays the same
Speed increases each time
Speed increases
Which of these can be stored in a variable?
PLAYERHEALTH
Game level
The moon’s orbit
internetSpeed
spirit-game
Which of the following are conditional operators?
==
=
===
and
not
Which statements are true about loops?
They can save time
They make lag
Can stop the game
They repeat tasks
They make graphics
Which situations use an if statement?
Checking if a player wins
Playing background music
Can stop the game
Giving extra life if score is high
Printing a name
Which are examples of boolean values?
true
"yes"
"no"
false
i == 1
Which can be part of a mathematical logic problem?
Counting coins
Choosing background instead
Checking game version
Calculating time
Can't solve problem
Which are correct uses of !=?
If health != 0
If music != playing
If coins != coins
If score != 100
If "playing" != playing
Which loops can run until a condition is false?
while
for
foreach
repeat until
switch
In logic, which statements are true?
true or false
true and false
not true
true != false
true == true
A function can…
Reduce code repetition
Store logic
Can stop the game
Be called many times
Only run once
Which of the following loops will stop eventually?
while x > 0 do
for i = 1, 5 do
while true do without break
repeat until score == 100
while true do with continue
Which parts of a program can contain variables?
functions
loops
Comments
conditional statements
GUI
Which are examples of short answer problem types?
How many coins in 30 seconds if one coin appears every 5 seconds?
Calculate distance if speed and time are given
Translate “Hello” to another language
Write the output of given code
Describe value to a variable
Which actions are possible with a loop?
Adding coins repeatedly
Showing timer countdown
Printing the same message 5 times
Changing player skin once
Can stop the game immediately
Which examples are basic programming concepts?
Variables
Loops
Conditional Statements
Comment
Which actions can break a loop?
Break
Changing loop condition
Continue
Return
Removing Code
Which are examples of variables?
score
PlayerName
background_Music
level-player
Ninner_
Which steps are part of problem solving?
Understand the problem
Plan the solution
Test the solution
Gambling
Guess the answer
Which examples show nested loops?
loop inside another loop
switch inside loop
while inside repeat
for inside while
foreach inside for
Which of these statements about functions are correct?
Functions can have inputs
Functions run automatically without being called
Functions can return values
Functions help reuse code
Functions no need to called in another line
Which can be inside a function?
loops
game settings
conditionals
another function
a bunch of variable
If a coin appears every 6 seconds, how many coins in 1 minute?
(a)
Starting with 50 health, losing 7 each hit, how many hits until health is ≤ 0?
(a)
A game gives 15 points per goal. How many goals for 150 points?
(a)
The sum of 5, 7, and 9 is?
(a)
If a loop runs from 1 to 20 with a step of 5, how many times does it run?
(a)
100 divided by 8, rounded down, is?
(a)
If a part moves 3 studs/sec for 12 seconds, how far?
(a)
Coins spawn every 3 seconds, collected for 27 seconds, how many?
(a)
If score = 0 and increases by 4 every loop for 5 loops, final score?
(a)
A loop doubles a number starting from 1, runs 4 times. Final number?
(a)
In a 200-stud race with checkpoints every 25 studs, how many checkpoints?
(a)
If a player gains 2 coins per second for 15 seconds, total coins?
(a)
10 % 4 equals?
(a)
In Lua, true and false evaluates to?
(a)
What is the output if score = 10 and a loop runs 3 times adding 5 points each time?
(a)
A player gains 2 health every second for 10 seconds. How much total health will they gain?
(a)
If lives = 3 and player loses 1 life each round, how many rounds until lives = 0?
(a)
What operator checks if two values are equal?
(a)
A monster appears every 4 seconds. How many appear in 20 seconds?
(a)
If speed = 5 and in a loop speed = speed * 2 runs twice, what is final speed?
(a)
What is the opposite of ==?'
(a)
If coins = 0 and each loop adds 3 coins, after 5 loops how many coins?
(a)
What data type is "Hello"?
(a)
In a function that runs a loop 4 times, printing “Hi” each time, how many “Hi” will be printed?
(a)
If player’s health is 100 and they lose 25 each hit, how many hits until health is 0?
(a)
A game timer counts down from 30 by 5 each second. How many seconds until 0?
(a)
In a loop from 1 to 10, how many even numbers are there?
(a)
function luasPersegiPanjang(panjang, lebar)
lebar = lebar or 10
return panjang * lebar
end
luasPresegiPanjang(4, 5)
(a)
function hitungJumlahDanSelisih(a, b)
return a + b, a - b
end
local jumlah, selisih = hitungJumlahDanSelisih(10, 4)
print(jumlah)
(a)
What is the main purpose of using a function in programming?
(a)
