Search Header Logo

Week 3 Tutorial Quiz

Authored by Wongsathorn Tonkultorn

Computers

University

Used 1+ times

Week 3 Tutorial Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

What is

var = 29 * 24 - 39 / 23 + 94

Statement

Expression

Neither

Both

Answer explanation

A statement is considered an expression

2.

MULTIPLE CHOICE QUESTION

20 sec • 10 pts

Media Image

What is the output from the call strange(3,100)?

3

4

5

Error!

None of the above

Answer explanation

Media Image

The function stops at the first return so the second and third is unreachable

3.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Media Image

What is the output from the call f(1,1)?

4

6

8

Error!

None of the answers

Answer explanation

Media Image

g(a, b) returns None which cannot be added together

4.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Media Image

What is the output from the call twice(twice(twice(2)))?

8

16

twice(2) + twice(2)

Error!

None of the answers

Answer explanation

Media Image

The output of one twice() becomes the input of the other twice()

5.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Media Image

What will be printed out from executing f(5) and g(5) ?

f(5) prints 'Here'

g(5) prints nothing

f(5) prints nothing

g(5) prints 'There'

f(5) prints 'Here'

g(5) prints 'There'

f(5) prints 'There'

g(5) prints nothing

None of the answers

Answer explanation

Media Image

For g(5), since 5 < 10, the else is not reached. And since 5 < 4 is false, nothing is printed!

6.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Media Image

What printed out from f(2), f(5), f(15)?

'There', 'Where', 'Here'

'Here', 'There', 'Where'

'Here', 'There', 'There'

'Here', 'Where', 'There'

'There', 'Where', 'Where'

7.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

Media Image

What printed out from executing g(2)?

'Here'

'There'

'Where'

'Here' and 'There'

'Here' and 'Where'

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?