wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Swift Coding Quiz 1

Total questions: 22

Worksheet time: 18mins

Name
Class
Date
1.

What best describes an algorithm?

a)

A step-by-step series of operations

b)

The computer equivalent of rhythm

c)

Only calculations that use advanced mathematics

d)

The same thing as an identifier

2.

Which of the following challenges would the provided code solve?

a)
b)
c)
d)
3.

What is a command ?

a)

a specific action for the computer to perform

b)

the order in which the commands are given

c)

the repeated action of a programmer

d)

algorithmic thinking skills

4.

What is a mistake in code called?

a)

error

b)

debug

c)

bug

d)

misfunction

5.

_________________ is telling a computer what to do.

a)

Call

b)

Conditionals

c)

Coding

d)

Composition

6.

A collection of commands grouped together and given a name. The set of commands can then be run with just the name of the set whenever it is needed. Like a shortcut.

a)

For Loop

b)

Function

c)

Sequence

d)

Composition

7.

By writing commands you give instructions to do something. Which command sequence is formatted correctly?

a)

collectGem()

moveForward()

b)

Collect Gem ()

Move Forward ()

c)

(moveForward)

(collectGem)

d)

move.Forward() collect.Gem()

8.

Which of the following is not a benefit of using functions?

a)

They can give you infinite loops

b)

They keep your code organized.

c)

They prevent repeated code

d)

They make larger programs easier to understand

9.

Which line is the correct way to declare a function?

a)

let myFunction = func ( ) {

b)

let func = myFunction ( ) {

c)

func myFunction ( ) {

d)

func = myFunction ( ) {

10.

What don't programmers like doing?

a)

Repeating themselves

b)

Repeating themselves

c)

Repeating themselves

d)

All of the above

11.

Which of these are written in "camel case"?

a)

FIRSTname

b)

firstName

c)

first_name

d)

first_name (camel)

12.

If your code is not running as intended what may be cause of the problem?

a)

Bugs

b)

interface

c)

sequence

d)

code

13.

What is a sequence ?

a)

specific actions for the computer to perform

b)

the order in which the commands are given

c)

repeated actions

d)

algorithmic thinking skills

14.

Which command is used to turn a switch on?

a)

toggle()

b)

activateSwitch()

c)

toggleSwitch()

d)

onSwitch()

15.

What is coding?

a)

Repeated actions in the program

b)

Algorithmic thinking skills

c)

Telling a ​computer what to do.

d)

None of the above

16.

What is the command used to gather jewels in Swift playground?

a)

collectJewel()

b)

collectGem()

c)

getGem()

d)

getJewel()

17.

What is debugging?

a)

errors in code

b)

creating a correct sequence of commands

c)

finding and fixing errors

18.

What is Swift playgrounds?

a)

A tool used to write a pseudo code for any program

b)

An advanced tool to create applications

c)

A powerful programming language created by Apple

d)

Algorithmic designer tools

19.

What is a function?

a)

An activity that is natural to the purpose of a person or thing

b)

An expression involving one or more variables

c)

A large or formal social event

d)

A collection of commands grouped together and given a name.

20.

What is Swift Playground?

a)

A tool used to write a pseudo code for any program

b)

Advanced tool to create applications

c)

Powerful programming language created by Apple

d)

An algorithmic designer tools

21.

Which is the correct code to have Byte move forward?

a)

moveForward()

b)

MoveForward ( )

c)

moveFor ( )

d)

moveForward ( )

22.

While defining a function we use the keyword:

a)

Func

b)

FUNC

c)

func

d)

funC