Search Header Logo
2.2 Subprograms

2.2 Subprograms

Assessment

Presentation

Computers

10th Grade

Easy

Created by

Leah Tomlinson

Used 1+ times

FREE Resource

11 Slides • 5 Questions

1

2.2 Subprograms

Slide image

2

Slide image

3

Slide image

4

Slide image

5

Open Ended

Write a procedure where the user enters a number, it then squares it and outputs the answer

6

Slide image

7

Slide image

8

Open Ended

Write a function that adds together two numbers that are passed to the function as parameters

9

Slide image

10

Slide image

11

Slide image

12

Multiple Choice

What would the following display?

PROCEDURE runningtotal(num as INT)

total = total + num

print("The total is " + str(total))

ENDPROCEDURE


#main program

runningtotal(6)

runningtotal(4)

1

"The total is 6

The total is 4

2

"The total is 6

The total is 10"

13

Multiple Choice

What needs to happen to the 'total' variable in the previous procedure in order for the program to work?

1

it needs to be declared locally

2

it needs to be declared globally

14

Slide image

15

Slide image

16

Open Ended

Give one reason why you would use a subprogram?

2.2 Subprograms

Slide image

Show answer

Auto Play

Slide 1 / 16

SLIDE