wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Tryout Bag. 4.1

Total questions: 70

Worksheet time: 55mins

Name
Class
Date
1.

In a game, a monster appears every 8 seconds. How many monsters appear in 1 minute?

a)

6

b)

7

c)

8

d)

5

2.

Which of the following best describes “programming”?

a)

Writing instructions for a computer to follow

b)

Drawing instructions on a computer

c)

Give a picture of instructions on a computers

d)

Add instruction for a computer to follow

3.

Which of these is NOT an example of a loop?

a)

for i = 1, 10 do

b)

while health > 0 do

c)

repeat ... until score == 100

d)

if score > 100 then

4.

Which is the best way to reuse code?

a)

Copy-paste it many times

b)

Delete it

c)

Write it in a comment

d)

Put it inside a function

5.

If a timer counts down from 10 to 0, it is using…

a)

A variable

b)

A function

c)

A conditional statements

d)

A loop

6.

Which is a variable in a game?

a)

Player’s score

b)

Game’s background music

c)

The color of the keyboard

d)

The GUI

7.

Which of the following describes a loop?

a)

A set of instructions repeated multiple times

b)

A single instruction

c)

A pause in the game

d)

A saved file

8.

If health is set to 0, what usually happens in a game?

a)

Player wins

b)

Player’s character dies

c)

Player’s score doubles

d)

Player’s speed increases

9.

Which logic operator means “both conditions must be true”?

a)

OR

b)

AND

c)

NOT

d)

==

10.

What is a conditional statement used for?

a)

To repeat a task

b)

To make decisions

c)

To store data

d)

To save a file

11.

In a game, if lives is less than 1, what should happen?

a)

Player levels up

b)

Game ends

c)

Player gets extra life

d)

Coins are doubled

12.

Which symbol in programming means “equal to”?

a)

==

b)

AND

c)

OR

d)

NOT

13.

If a loop runs from 1 to true, how many times will it repeat?

a)
1
b)

Error

c)

Looping just once

d)
infinite
14.

What is the main purpose of a function?

a)

To store graphics

b)

To reuse code

c)

To slow down the program

d)

To stop a game

15.

In programming, what is an algorithm?

a)

A music beat

b)

A step-by-step solution

c)

A character skin

d)

A game map

16.

Which is an example of using an if statement?

a)

If player’s score is 100, show “You Win!”

b)

Display the score

c)

Play music

d)

Save the game

17.

Which loop will keep running forever if there is no condition to stop it?

a)

for

b)

while

c)

repeat

d)

until

18.

Which data type is “true” or “false”?

a)

String

b)

Boolean

c)

Number

d)

Condition Statement

19.

What happens if you set a variable speed = speed + 1 in a loop?

a)

Speed decreases

b)

Speed stays the same

c)

Speed increases each time

d)

Speed increases

20.

Which of these can be stored in a variable?

a)

PLAYERHEALTH

b)

Game level

c)

The moon’s orbit

d)

internetSpeed

e)

spirit-game

21.

Which of the following are conditional operators?

a)

==

b)

=

c)

===

d)

and

e)

not

22.

Which statements are true about loops?

a)

They can save time

b)

They make lag

c)

Can stop the game

d)

They repeat tasks

e)

They make graphics

23.

Which situations use an if statement?

a)

Checking if a player wins

b)

Playing background music

c)

Can stop the game

d)

Giving extra life if score is high

e)

Printing a name

24.

Which are examples of boolean values?

a)

true

b)

"yes"

c)

"no"

d)

false

e)

i == 1

25.

Which can be part of a mathematical logic problem?

a)

Counting coins

b)

Choosing background instead

c)

Checking game version

d)

Calculating time

e)

Can't solve problem

26.

Which are correct uses of !=?

a)

If health != 0

b)

If music != playing

c)

If coins != coins

d)

If score != 100

e)

If "playing" != playing

27.

Which loops can run until a condition is false?

a)

while

b)

for

c)

foreach

d)

repeat until

e)

switch

28.

In logic, which statements are true?

a)

true or false

b)

true and false

c)

not true

d)

true != false

e)

true == true

29.

A function can…

a)

Reduce code repetition

b)

Store logic

c)

Can stop the game

d)

Be called many times

e)

Only run once

30.

Which of the following loops will stop eventually?

a)

while x > 0 do

b)

for i = 1, 5 do

c)

while true do without break

d)

repeat until score == 100

e)

while true do with continue

31.

Which parts of a program can contain variables?

a)

functions

b)

loops

c)

Comments

d)

conditional statements

e)

GUI

32.

Which are examples of short answer problem types?

a)

How many coins in 30 seconds if one coin appears every 5 seconds?

b)

Calculate distance if speed and time are given

c)

Translate “Hello” to another language

d)

Write the output of given code

e)

Describe value to a variable

33.

Which actions are possible with a loop?

a)

Adding coins repeatedly

b)

Showing timer countdown

c)

Printing the same message 5 times

d)

Changing player skin once

e)

Can stop the game immediately

34.

Which examples are basic programming concepts?

a)

Variables

b)

Loops

c)

Print

d)

Conditional Statements

e)

Comment

35.

Which actions can break a loop?

a)

Break

b)

Changing loop condition

c)

Continue

d)

Return

e)

Removing Code

36.

Which are examples of variables?

a)

score

b)

PlayerName

c)

background_Music

d)

level-player

e)

Ninner_

37.

Which steps are part of problem solving?

a)

Understand the problem

b)

Plan the solution

c)

Test the solution

d)

Gambling

e)

Guess the answer

38.

Which examples show nested loops?

a)

loop inside another loop

b)

switch inside loop

c)

while inside repeat

d)

for inside while

e)

foreach inside for

39.

Which of these statements about functions are correct?

a)

Functions can have inputs

b)

Functions run automatically without being called

c)

Functions can return values

d)

Functions help reuse code

e)

Functions no need to called in another line

40.

Which can be inside a function?

a)

loops

b)

game settings

c)

conditionals

d)

another function

e)

a bunch of variable

41.

If a coin appears every 6 seconds, how many coins in 1 minute?

(a)  

42.

Starting with 50 health, losing 7 each hit, how many hits until health is ≤ 0?

(a)  

43.

A game gives 15 points per goal. How many goals for 150 points?

(a)  

44.

The sum of 5, 7, and 9 is?

(a)  

45.

If a loop runs from 1 to 20 with a step of 5, how many times does it run?

(a)  

46.

100 divided by 8, rounded down, is?

(a)  

47.

If a part moves 3 studs/sec for 12 seconds, how far?

(a)  

48.

Coins spawn every 3 seconds, collected for 27 seconds, how many?

(a)  

49.

If score = 0 and increases by 4 every loop for 5 loops, final score?

(a)  

50.

A loop doubles a number starting from 1, runs 4 times. Final number?

(a)  

51.

In a 200-stud race with checkpoints every 25 studs, how many checkpoints?

(a)  

52.

If a player gains 2 coins per second for 15 seconds, total coins?

(a)  

53.

10 % 4 equals?

(a)  

54.

In Lua, true and false evaluates to?

(a)  

55.

What is the output if score = 10 and a loop runs 3 times adding 5 points each time?

(a)  

56.

A player gains 2 health every second for 10 seconds. How much total health will they gain?

(a)  

57.

If lives = 3 and player loses 1 life each round, how many rounds until lives = 0?

(a)  

58.

What operator checks if two values are equal?

(a)  

59.

A monster appears every 4 seconds. How many appear in 20 seconds?

(a)  

60.

If speed = 5 and in a loop speed = speed * 2 runs twice, what is final speed?

(a)  

61.

What is the opposite of ==?'

(a)  

62.

If coins = 0 and each loop adds 3 coins, after 5 loops how many coins?

(a)  

63.

What data type is "Hello"?

(a)  

64.

In a function that runs a loop 4 times, printing “Hi” each time, how many “Hi” will be printed?

(a)  

65.

If player’s health is 100 and they lose 25 each hit, how many hits until health is 0?

(a)  

66.

A game timer counts down from 30 by 5 each second. How many seconds until 0?

(a)  

67.

In a loop from 1 to 10, how many even numbers are there?

(a)  

68.

function luasPersegiPanjang(panjang, lebar)
lebar = lebar or 10
return panjang * lebar
end

luasPresegiPanjang(4, 5)

(a)  

69.

function hitungJumlahDanSelisih(a, b)
return a + b, a - b
end

local jumlah, selisih = hitungJumlahDanSelisih(10, 4)
print(jumlah)

(a)  

70.

What is the main purpose of using a function in programming?

(a)