0% found this document useful (0 votes)
7 views104 pages

Stick Multiplication Method Explained

The document outlines a method for stick multiplication of two-digit numbers, emphasizing the importance of clear, unambiguous instructions in algorithms. It discusses concepts such as computational thinking, decomposition, abstraction, and algorithmic thinking, highlighting their significance in problem-solving. Additionally, it covers the representation of algorithms through flowcharts and the use of variables in programming.

Uploaded by

sh1m455
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views104 pages

Stick Multiplication Method Explained

The document outlines a method for stick multiplication of two-digit numbers, emphasizing the importance of clear, unambiguous instructions in algorithms. It discusses concepts such as computational thinking, decomposition, abstraction, and algorithmic thinking, highlighting their significance in problem-solving. Additionally, it covers the representation of algorithms through flowcharts and the use of variables in programming.

Uploaded by

sh1m455
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Algorithms

1 2 3 4

Take two Draw them Identify the Count the


two-digit as tens and three zones intersections
numbers, units stcks from left to
e.g. 12 and right
13

A Trick…
1 2 3 4

Take two Draw them Identify the Count the


two-digit as tens and three zones intersections
numbers, units sticks from left to
e.g. 12 and right
13

A Trick…
1 2 3 4

Take two Draw them Identify the Count the


two-digit as tens and three zones intersections
numbers, units sticks where the from left to
e.g. 12 and lines right
13 intersect

A Trick…
1 2 3 4
A Trick…
Take two two- Draw them as Identify the Count the
digit tens and units three zones intersections
numbers, e.g. sticks where the lines from left to
12 and 13 intersect right

• What have we got?


• Do this yourself with 12 and 13
• Then try 11 x 14

Extension: 23 x 15
1 6

5
1 2 3 4

Take two Draw them as Identify the Count the


two-digit tens and units three zones intersections
numbers, sticks where the from left to
lines intersect right

11 x 14

154
A Trick…
1 4

5
1 2 3 4

Take two Draw them as Identify the Count the


two-digit tens and units three zones intersections
numbers, sticks where the from left to
lines intersect right

◦ 23 x 15

◦ What is the
A Trick… answer here?

◦ 345 2 15

13
The Maths Trick
• This is stick multiplication
• Its first recorded use was in 11BC
• Did you need to know the objective to get the right answer?
• No, you just need to follow the instructions correctly

• Did you need to understand the maths to do the trick?


• No, the steps hide the underlying maths
The Maths Trick
• How could you instruct someone to do this?
• First, you need to understand the aim
• Then identify the steps
• Write this out as a set of unambiguous instructions

• What is an unambiguous statement?


• An unambiguous statement is one that has only one meaning
Ambiguous Statements
Why are these natural language statements ambiguous?
Discuss in pairs and be ready to feed back to the class.
1. His father told him to tidy his room.
2. Look at the dog with one eye.
3. The boy chased his friend wearing a red hat.
4. I saw him with binoculars.
Ambiguous Statements
Why are these statements ambiguous?
1. His father told him to tidy his room.
Whose room was to be tidied?
2. Look at the dog with one eye.
Does the dog have one eye or are you supposed to close one of yours?
3. The boy chased his friend wearing a red hat.
Who was wearing the hat?
4. I saw him with binoculars.
Who has the binoculars?
Natural Language
• What is natural language?
• Natural Language: ordinary, spoken language such as English – not an
artificial language such as computer code.

• Can we use natural language to express an algorithm?


1. Draw lines for the first operand Algorithm
• For each group of ten in the first operand, draw a single straight line.
• Leave a gap and then, in parallel, draw a single straight line for each unit in the first operand.
2. Draw lines for the second operand
• At a right angle to the lines representing the first operand, draw a single straight line for each
group of ten in the second operand.
• Leave a gap and then, in parallel, draw a single straight line for each unit in the second
operand.
3. Identify intersection zones
• Visually locate the three zones where the lines from the first and second operands intersect.
4. Count intersections:
• Count the number of intersections in each of the three zones.
5. Combine the counts:
• Write out the number of intersections from each zone in order from left to right to form your
final solution.
Limitation: This method only works for multiplying two, two-digit numbers without carrying over.

What do you think about this natural language algorithm


• It is difficult to write clear and
unambiguous instructions using
natural language
• Trying to write them clearly can
result in them being very long
• We need a more formal way of
writing instructions, particularly
when they are complex
What is computational thinking?
• Computational thinking is a systematic approach to
solving problems.

• This involves understanding a problem and


developing possible solutions that can be
understood by a computer, person, or both.

Terminology: A problem in Computer Science is just a


task; something that needs to be done
What is computational thinking?
There are three characteristics of computational thinking that you need
to be aware of:
● Decomposition
● Abstraction
● Algorithmic thinking
What is decomposition?
• Imagine you are organising a trip to
the Tower of Pisa?

• How might you start planning your


trip?
What is decomposition?
You can start by breaking down the problem
into smaller parts:
1. Which mode of transport are you using
to get from the UK to Pisa?
2. How can you get to the tower from
there?
3. How can you book tickets?
What is decomposition?
Trip to Tower of Pisa
Decomposition is the process of
breaking down a problem into sub-
problems

Each sub-problem is broken down Transport Tickets


until it is manageable

A structure diagram can be used


to visualise a problem

UK to Pisa Pisa to Tower


What is abstraction?
• Abstraction is the process of removing unnecessary details to allow
you to focus on what is important

• This allows you to develop a general idea of what the problem is and
how to solve it
What is abstraction?
• Maps are a good example of
abstraction
• What does this map not include?
• What buildings look like
• Shop names
• Parking spaces etc.
• Maps only include the information
that is relevant to the problem
• E.g. this map shows roads, rivers,
and names of important landmarks
What is algorithmic thinking?
• Algorithmic thinking is a way of getting to a solution called an
algorithm through the clear definition of the steps needed
• What is an algorithm?
• An algorithm is a finite sequence of unambiguous step-by-step
instructions which, when followed, solve a problem
• Finite means countable; having a limit or an end. The antonym is
infinite
Algorithms and computer programs
• An algorithm describes the steps of a solution

• A computer program is an implementation of this solution, written in


a programming language

• Programs written in a programming language are precise enough for a


machine to translate and then execute without human interpretation
Representing Algorithms
• In computer science, algorithms can be represented in a number of
ways

• You can use flowcharts and written descriptions to help you to focus
on the logic of a solution without worrying about programming errors

• This results in more accurate solutions, particularly when problems


are complex
Flowcharts
• A flowchart is a way of visually representing
an algorithm

• What do you think this flowchart does?


Programming Concepts - Variables
• What are year_born, this_year and result?
• year_born and this_year are labels (names) for where
we store input data
• result is a label for where we store a calculated value
that we are going to output
• They are all variables
• A variable is a label used for an area of memory used to
store data
• Do the exercise on OneNote
Programming Concepts - Variables
• What are the variables in this flowchart?
• number1
• number2
• answer
• What are the keywords?
• GET
• PUT
• Start
• End

Check your answer and correct it, if necessary


Creating flowcharts

In the next activity, you are going to develop a


flowchart.
First though, you need to know what the
different flowchart symbols are and what they
represent.
Flowchart symbols
A flowchart is a way of visually representing an algorithm using
standard shapes

Terminators are used to show the the start and end of an algorithm

Arrows are used to show the order of instructions


Flowchart symbols
Use this symbol to ask the user to
enter something.
The input value is stored in variable
name, in this example.

Raptor adds the GET keyword, you


do not need to type it
Flowchart symbols
Use this symbol to output
something to the user.
This example outputs Hello, a
space and then the value stored in
variable name
Raptor adds the PUT keyword , you
do not need to type it
Flowchart symbols
A process (also called assignment) is
represented by a rectangle.
It is used for an instruction or calculation.

This block sets the variable number to 10

This block increases number by 20


Flowchart symbols

• A decision (also called selection) allows different routes through the


algorithm.
• It has two labelled branches: Yes and No
Administration
On your laptop
• Click on the Install Raptor
link on SharePoint/Autumn
Term
• Scroll down to Download
RAPTOR
• Use this link
Run Raptor
• Now put your laptop away
• On the desktop computer:
• Open the Educational Resources folder on the desktop
• Open the Computing folder
• Run Raptor
Click on Windows/Tile Vertical
Raptor

Output area

Work area

Memory
area
Demo: Age this year
• We want to write a flowchart that finds out how old someone will be
this year
• What inputs do we need from the user?
• The year they were born
• The current year
• What steps do we need to follow to get the answer?
Demo: age this year
1. Ask the user for the year they were born and store this in variable
year_born
2. Ask the user for the year it currently is and store this in variable
this_year
3. Subtract the this_year from the year_born and store this in
variable result
4. Output what is stored in the result variable

• Raptor DEMO
• Notice that you do not type the GET or PUT part…
Screenshots
Use the snipping tool for
screenshots
Screenshots must include:
• The flowchart
• The memory area
• The output window
when the flowchart has run
• Any programs you write*
• If you finish quickly, you can create a program for the flowchart in any
programming language, e.g. Scratch or Python
• Complete the Raptor Exercises/DEMO: Age this year on OneNote
• Make sure
that you have
included the
variables and
DEMO: Age this year

master
console in
your
screenshot
Input Expected Output Actual Output

DEMO: Age this year 2011


2025
This year, you will
be 14 years old

• Use the test table to record the results of


testing your flowchart
• One test case might be:
• Input: 2010 and 2024
• Expected output: This year, you will be 14 years old
• Actual output: what your flowchart actually outputs when you ran
it

• Is one test case enough?


• Make sure you have properly completed at least two test cases
DEMO: Age this year
• Your test table should look like this:
Input Expected Output Actual Output
2011 This year, you will be 14 years This year, you will be 14 years
2025 old old
2000 This year, you will be 25 years This year, you will be 25 years
2025 old old

• The actual output must exactly match what your flowchart produces
Using Raptor The input prompt requires quotes

• You must use


quotation marks
around input prompts
• If it is not a keyword,
mathematical operator,
variable or number, it
needs quotes around
it!

This is the name of the variable


where the user input will be stored
Join fixed messages and variables
using the + operator

Using Raptor
• You can output fixed
messages and variables by
using the + operator
(concatenation)
• Don’t forget to include
quotes and spaces
• If the user enters 5 and 10,
the output is:
The answer is 15
Using Raptor
• If the user enters 10 and 20,
what will this flowchart
output?
• 10 + 20 = 30
Data Types
• When we store values in variables, we consider two things:
• What sort of values do we want to store?
• What operations do we want to perform on those values?
For example:
• If we want to store an age, we might choose to store a whole number
and we might want to do maths on that number
• If we want to store a name, we might choose to store a letters and we
might want to do join it to other names or change it to uppercase.
• Read the table and complete the first two columns for the subject set
and mobile numbers
Example What sort of values will we What operations might we do?
store?
Subject set Letters and numbers, e.g. 3D1 Extracting a character, e.g. the
first character tells us the year
group
Mobile number Numbers and characters like Extracting part of it, e.g. the +44
space, hyphen, + tells us the country
Data Types
• An integer data type is used for whole numbers
• A floating-point data type is used for decimal numbers
• A Boolean data type is used for True/False or Yes/No values
• A string data type is more complicated:
• It must be used when you store letters or punctuation
• The values are always enclosed in quotes “”
• You use it to store digits when you can’t use an integer or floating-
point data type, e.g. “0123” or “+441727 123123”
• Complete the data type column in the table
Example What sort of values What operations might we Data Type
will we store? do?
Age Whole numbers Maths, e.g. add 1 integer

Savings Decimal numbers Maths, e.g. subtract 20.50 floating-


amount point
Surname Alphabetic Join it to other names, string
characters change the case
Have I Yes/No; True/False Flip it from Yes to No; True Boolean
finished? to False or vice versa
Example What sort of values will What operations might Data type
we store? we do?
Subject set Letters and numbers, Extracting a character, String
e.g. 3D1 e.g. the first character
tells us the year group
Mobile Numbers and characters Extracting part of it, String
number like space, hyphen, + e.g. the +44 tells us the
country

Are we likely to do any maths on the subject set or mobile number?


• We might extract the year group from the subject set and add one, but
we can’t add 1 to 3D1 using maths
• We are not going to do any maths on a mobile number
Task 1: Your age in days
• Create a Raptor flowchart that works out how old you are in days
(assume 365 days a year)
• Use descriptive input prompts and output messages like:
• Input prompt: How old are you?
• Output message: You are <result> days old
• Fill in the test table by running your flowchart

• Finished? Write a program to implement this flowchart. You can use


Scratch or Python. Don’t forget to screenshot your code and add it to
the OneNote document; include your testing.

Check that the output is actually correct by using a calculator!


Task 1 Solution: Your age in days
Natural Language Algorithm
1. Ask the user how old they are and store this in
variable age
2. Multiply age by 365 and store this in variable
answer
3. Output what is stored in variable answer
Heads or Tails
• We are going to create a flowchart
to simulate a coin toss
• What are the natural language
steps?
Coin Toss
Natural Language Algorithm
1. Ask the user to guess either “Heads” or “Tails” and store it in
variable choice
[Link] choose either “Heads” or “Tails” and store this in variable
flip
[Link] the value stored in flip is the same as the value stored in choice,
output a message to tell the user they won
4. Otherwise, output a message to tell the user that they lost.
Flowchart for coin toss
Start

Begin the flowchart with a


start terminator.
Flowchart for coin toss
Start

OUTPUT Ask the user to guess either


“Heads or
“Heads” or “Tails” and store
Tails?”
the response in a variable
called choice.
INPUT choice
Flowchart for coin toss
Start
Simulate a coin toss by
OUTPUT randomly generating either
“Heads or
“Heads” or “Tails”. Store this
Tails?”
in a variable called flip.

INPUT choice

flip = Randomly pick


“Heads” or “Tails”
Flowchart for coin toss
Start
choice = False
OUTPUT
flip?
“Heads or
Tails?”
True

INPUT choice
Compare the coin flip with
the user’s choice.

flip = Randomly pick


“Heads” or “Tails”
Flowchart for coin toss
Start
choice = False
OUTPUT
flip?
“Heads or
Tails?”
True
OUTPUT
INPUT choice “You
won!” If the coin flip is the same as
the user’s choice, tell the
flip = Randomly pick user they won.
“Heads” or “Tails”
Flowchart for coin toss
Start
Otherwise, tell the user
choice = False they lost.
OUTPUT
flip?
“Heads or
Tails?”
True
OUTPUT OUTPUT
INPUT choice “You “You
won!” lost!”

flip = Randomly pick


“Heads” or “Tails”
Flowchart for coin toss
Start
choice = False
OUTPUT
flip?
“Heads or
Tails?”
True
OUTPUT OUTPUT
INPUT choice “You “You
won!” lost!”

flip = Randomly pick


“Heads” or “Tails”
End Finish the flowchart with an
end terminator.
Flowchart for coin toss
Start
choice = False
OUTPUT
flip?
“Heads or
Tails?”
True
OUTPUT OUTPUT
INPUT choice “You “You
won!” lost!”

flip = Randomly pick


“Heads” or “Tails”
End
Flipping a coin…
• We are going to use a randomly generated
number (0 or 1) to represent heads or tails
• Raptor can generate a random number for you
• However, it is always between 0.0 and 0.9
• Use this to generate a random integer between 0
and 1 : floor(random*2)

floor rounds down…


DEMO: Coin Toss
Improved Natural Language Algorithm
1. Ask the user to guess either heads (0) or tails (1) and store it in
variable choice
[Link] a random integer between 0 and 1 and store this in variable
flip
[Link] the value stored in flip is the same as the value stored in choice,
output a message to tell the user they won
4. Otherwise, output a message to tell the user that they lost.
DEMO
• Teacher demo
DEMO: Coin Toss
• How many times do you need to
test this?
• Until you get both a win and a loss
for a guess of both heads and tails!

• Create this flowchart and paste a


screenshot on OneNote
• Complete the test table
Task 2: Is it a double?
Create a flowchart that simulates two dice being
rolled and checks if the values are the same.
This is known as rolling a double.
Output a message to the user that indicates if
they have rolled a double or not.
Start with the natural language algorithm
Task 2 Solution: Is it a double?
Natural Language Algorithm
1. Generate a random number between 1-6 to simulate a dice roll and store it in
variable die1
2. Generate a random number between 1-6 to simulate a dice roll and store it in
variable die2
3. If the value stored in die1 is the same as the value stored in die2, output a message
to tell the user they rolled a double.
5. Otherwise, tell the user they did not roll a double.
Task 2 Solution: Is it a double?
Example output
That wasn't a double! You rolled a 6
and a 4
You rolled a double 1
That wasn't a double! You rolled a 5
and a 1
You rolled a double 5
That wasn't a double! You rolled a 3
and a 6
Task 3: Which is bigger?
• Create a flowchart in Raptor which asks the user to input two
numbers.
• It should then output which of the two numbers is larger, or if they
are equal
• Start with the natural language algorithm
• Use descriptive input prompts and output messages
• Don’t forget your screenshots and testing
Task 3 Solution: Which is bigger?
Natural Language Algorithm
1. Ask the user to enter a number and store it in variable number1
2. Ask the user to enter a number and store it in variable number2
3. If number1 is equal to number2, output a message to say that the
values are equal
4. Otherwise, check if the value stored in number1 is greater than the
value stored in number2
5. If it is, output a message to say that the first number was larger
6. Otherwise, output a message to say that the second number was
larger
Task 3: Which is bigger?
Copy the Rubrics
• Copy the Checking and
Marking sections from
the content library pages
to the top of Tasks 2 – 10

• They are written for each


task, so copy them
correctly
Task 4: Divisible Hint*

• Ask the user to enter two numbers


• Output a message indicating whether or not
number1 is exactly divisible by number2
• Hint: The modulus operator (%) gives you the
remainder of a division. You might like to try this
flowchart to help you work out how it works.
• Do the natural language algorithm once you have
worked out what this flowchart tells you.

* Still confused? Try changing the 2 to a 5 and try running it a few


more times.
Task 4 Solution: Divisible
Natural Language Algorithm
1. Ask the user to enter a number and store it in variable number1
2. Ask the user to enter a number and store it in variable number2
3. Calculate the remainder of number1 divided by number2 and store
this in variable remainder
4. If the remainder is equal to zero, then output a message to say that
number1 is divisible by number2
5. Otherwise, output a message to say that number1 is not divisible by
number2
Task 4 Solution: Divisible
• Check that you have given enough test
cases
• You must have at least one example of
divisible and at least one example of
not divisible
• Otherwise, your output could be
correct by chance…
Task 5: Simple calculator
• Create a Raptor flowchart that asks the user to enter two numbers
and then an operation
• The operation should be one of: ‘add’, ‘subtract’, ‘divide’, ‘multiply’ or
‘remainder’
• Do the natural language algorithm first
• Output an error message if they enter anything other than these
options for the operation
• Output the correct result
• E.g., If the user enters 10, 3 and remainder, your flowchart should
output 1
Task 5 Solution: Simple Calculator
Natural Language Algorithm
1. Ask the user to enter a number and store it in variable number1
2. Ask the user to enter a number and store it in variable number2
3. Ask the user to enter an operation (add, subtract, multiply, divide or remainder) and
store it in variable operation
4. If the operation contains “add”, add the values stored in number1 and number2 and
output that result
5. Otherwise, if the operation contains “subtract”, subtract the value stored in number2
from the value stored in number1 and output that result
6. Otherwise, if the operation contains “multiply”, multiply the values stored in number1
and number2 and output that result
7. Otherwise, if the operation contains “divide”, divide the value stored in number2 by
the value stored in number1 and output that result
8. Otherwise, if the operation contains “remainder”, find the remainder of the value
stored in number1 divided by the value stored in number2 and output that result
9. Otherwise, let the user know the operation entered is invalid.
Task 5 Solution: Simple Calculator
Task 6: Club Member
• Ask the user to enter their age and whether or not they are club
member. Output the appropriate price using these rules:
Age Is a member? Price (£)
Under 15 Either £1
15 or older Yes £2
15 or older No £3

• Do the natural language algorithm first


Task 6 Solution: Club Member
Natural Language Solution
1. Ask the user to enter their age and store it in variable age
2. Ask the user if they are a member (Yes or No) and store this in
variable member *
3. If the value stored in age is less than 15, output the price is £1
4. Otherwise, if the member contains “Yes”, then output the price is £2
5. Otherwise, output that the price is £3

* Anything to say about this?


Task 6 Solution: Club
• Ask the user to enter their age
and whether or not they are
club member. Output the
appropriate price using these
rules:
Age Is a member? Price (£)
Under 15 Either £1
15 or older Yes £2
15 or older No £3

• Test data? At least one example


of each combination
Task 6 Solution: Club
• Ask the user to enter their age and
whether or not they are club
member. Output the appropriate
price using these rules:
Age Is a member? Price (£)
Under 15 Either £1
15 or older Yes £2
15 or older No £3

• Why is this a better solution?


Tracing / Dry Running
• You need to be able to work out what an algorithm does without
running it
• This involves carefully working through the algorithm and recording
the variable values and outputs at each step
What is the output?
Question .
What will be output when this flowchart
is executed?
1 4
2 10
3 15
4 There is an error in the flowchart
What is the output?
State .
count
total

Output . Copy this onto your


whiteboard and
trace the flowchart
step by step
What is the output? Walkthrough
State .
count 1 2 3 4 5

total 0 1 3 6 10

Output .

10
Repetition or Looping
• Notice that this flowchart loops back to
the decision?
• As you have seen, this is causing part of
the algorithm to repeat
• This is very useful!
• It is called repetition or looping
Selection is making a choice in an Repetition or looping is repeating some
algorithm part of an algorithm. The loop is
controlled by a decision or selection
Demo: Repetition
• Use the loop block
• Notice that the “Yes” goes to end
• You need to think about what goes in the decision
• Put the blocks to repeat underneath the decision
block

• Do this and paste a screenshot on OneNote


• Complete the natural language algorithm
Demo: Counting
Natural Language Algorithm
1. Create a variable called count and store the value 1 in it.
2. If the value stored in variable count is greater than 5 then
stop
3. Otherwise,
• output the value stored in count
• Increase the value stored in count by 1
• Go back to step 2
Task 7: Counting
• Create a flowchart that uses a loop to output numbers from 10 to 20
in steps of 2
• Your flowchart should output 10, 12, 14, 16, 18, 20
• Use the previous example as a model
• Do the natural language algorithm first
Task 7: Counting
• Create a flowchart that uses a loop to output numbers from 10 to 20
in steps of 2
• Your flowchart should output 10, 12, 14, 16, 18, 20
• Use the previous example as a model
• Do the natural language algorithm first
Task 7 Solution: Counting
Natural Language Algorithm
1. Create a variable called count and store the value 10 in it.
2. If the value stored in variable count is greater than 20
then stop
3. Otherwise,
• output the value stored in count
• Increase the value stored in count by 2
• Go back to step 2
Task 8: Counting with input
• Create a flowchart that asks the user what number they want you to
count up to. E.g., if they enter 10, count from 1 to 10
• Do the natural language algorithm first
Task 8 Solution : Counting with input
Natural Language Algorithm
1. Create a variable called count and store the value 1 in it.
2. Ask the user to enter the maximum value and store this in
variable maximum
3. If the value stored in variable count is greater than the
value stored in maximum then stop
4. Otherwise,
• output the value stored in count
• Increase the value stored in count by 1
• Go back to step 2
Task 9: Times table
• Create flowchart that asks the user to enter a number and then
outputs the 5 times table up to that multiple
• E.g. If they enter 10, you should output the 5 times table up to 10 x 5
• Hints:
1. Start by just outputting the multiples, e.g. 1 to 10
2. Then output the text, e.g. 1 x 5 =, 2 x 5 = etc.
3. Then output the actual calculation
• Extension: Ask for both numbers as input and output in this format: 1
x 5 = 5 etc.

Complete the page on OneNote


Task 9 Solution: Times table
Task 9 Solution: Times table
• Extension: Ask for both numbers as input and
output in this format: 1 x 5 = 5 etc.
Task 10: Guessing Game
• Generate a random secret number between 1 and 10
• Create a guessing game that asks the user to guess it
• Allow the user to keep guessing until they get the number right
• Do the natural language algorithm first
Task 10 Solution: Guessing Game
• Create a guessing game that allows the
user to keep guessing until they get the
number right

• Test data? E.g.


• 14
• 12 14
• 16 14
• 1 20 14
• 30 4 14
Extension Task 11: Factorial
• Create a flowchart that finds the factorial of a given number
• The factorial of 10 is 1*2*3*4*5*6*7*8*9*10 = 3,628,800
Solution steps:
1. Get a number to use
2. Start with a multiple of 1 and a current factorial of 1
3. Repeat while the multiple is not equal to the number
• Increment the multiple by 1
• Set the current factorial to the current factorial * the multiple
• Go back to step 3
4. Output the current factorial
5. Stop
Solution

Extension Task 11: Factorial


• Create a flowchart that finds the factorial of a given number
• The factorial of 10 is 1*2*3*4*5*6*7*8*9*10 = 3,628,800
Solution steps:
1. Get a number to use
2. Start with a multiple of 1 and a current factorial of 1
3. Repeat while the multiple is not equal to the number
• Increment the multiple by 1
• Set the current factorial to the current factorial * the
multiple
• Go back to step 3
4. Output the current factorial
5. Stop
Finished?
• Do the challenge tasks on OneNote

You might also like