wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Apple Swift Coding 1 - Lesson 6 - 7

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What does API stand for?

a)

Actually Pretty Important

b)

Application Programming Interface

c)

Available Program Interpretation

d)

Automatic Program Input

2.

What best describes an algorithm?

a)

Only calculations that use advanced mathematics

b)

The computer equivalent of rhythm

c)

A step by step series of operations

d)

The same thing as an identifier

3.

What is API?

a)

A safety check to make sure programs work

b)

A tool for writing programs

c)

A rating given to experienced programmers

d)

The set of functions you can use with a particular programming area.

4.

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

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

5.

With the following code, what would you expect to see in the console in a playground?


func saySomething ( ) {

print ("Functions are awesome")

saySomething( )

}

saySomething ( )

a)

Functions are awesome, once

b)

Functions are awesome, twice

c)

Functions are awesome, repeated over and over and over

d)

Nothing

6.

With the following code, what would you expect to see in a console playground?


func saySomething ( ) {

print ("Functions are awesome")

}

saySomething ( )

a)

saySomething

b)

Functions are awesome

c)

Nothing

d)

Something

7.

With the following code, what would you expect to see in the console in a playground?


func saySomething ( ) {

print ("Functions are awesome")

}

a)

Functions are awesome

b)

saySomething

c)

Something

d)

Nothing

8.

What's another word for the lines of code that a function contains?

a)

Body

b)

Clause

c)

Parameters

d)

Return Value

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