Worked Examples - Incremental Software Development Worked Example

Slides:



Advertisements
Similar presentations
CMP-MX21: Lecture 5 Repetitions Steve Hordley. Overview 1. Repetition using the do-while construct 2. Repetition using the while construct 3. Repetition.
Advertisements

11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
Mental Arithmetic Strategies Scotts Primary School. Mental Arithmetic Scheme.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Mental Arithmetic Strategies
Repetition Structures
The more difficult topics
A1 Algebraic manipulation
Worked Examples Theory and Practice
What to do when a test fails
Are 4(5x + 2) and 4(5x) +4(2) equivalent expressions?
Algorithm and Ambiguity
University of Washington Computer Programming I
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Using a Stack Chapter 6 introduces the stack data type.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Persuasive Elaboration
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
For example, how can you use exponents to write
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
2 3 = …. LearnZillion Notes:
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Learning to Program in Python
OOP Paradigms There are four main aspects of Object-Orientated Programming Inheritance Polymorphism Abstraction Encapsulation We’ve seen Encapsulation.
Number and String Operations
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Why do you make mistakes?
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Using a Stack Chapter 6 introduces the stack data type.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do.
How do you determine an author’s purpose? LearnZillion Notes:
Using Statistical techniques in Geography
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Key Words and Introduction to Expressions
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
PROGRAMMING Sub Procedures I.
Coding Concepts (Basics)
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Algorithm and Ambiguity
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
3.1 Iteration Loops For … To … Next 18/01/2019.
Learning Intention I will learn about evaluating a program.
Using a Stack Chapter 6 introduces the stack data type.
Using a Stack Chapter 6 introduces the stack data type.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Back to School Maths Night 04/02/19.
Introduction to Repetition
N7 Prime factor decomposition, HCF and LCM
Learning Intention I will learn about the different types of programming errors.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Substituting into expressions.
Introduction to Repetition
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Learning Intention I will learn about the standard algorithm for input validation.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Starter.
3.2 Working with Data Scope of variables 29/07/2019.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Silly mistakes: why we make them and what we can do about them
Problem Solving Fall 2016.
For example: How do you show an increase of 12% over the original cost, if the original cost is $x? LearnZillion Notes: --This is your hook. Start with.
I wonder…2 _ 1 2 ? LearnZillion Notes:
Substituting into expressions.
LearnZillion Notes: --This is your hook. Start with a question to draw the student in. We want that student saying, “huh, how do you do X?” Try to be specific.
Presentation transcript:

Worked Examples - Incremental Software Development Worked Example Theory and Practice This technique uses the worked examples approach to work through the solution to a software development task.

Programming Example Here's the problem Create a program that asks for three numbers, calculates the total and average and displays this information. and here's one possible solution: SET total TO 0 FOR step FROM 1 TO 3 DO RECEIVE nextNum FROM KEYBOARD SET total TO total + nextNum END FOR SET average TO total / 3.0 SEND "The average is " TO DISPLAY SEND average TO DISPLAY The problem here is one you may have seen before. Take some time to read it over. The problem given to pupils is at the top.

And here's the Worked Example: Step 1 Let's analyse the problem in order to develop a plan Reading the problem again Create a program that asks for three numbers, calculates the total and average and displays this information. and simply breaking the sentence into sections, it looks as though there may be three steps to the plan: PLAN ask for three numbers calculate total and average display this information A worked example will talk through the problem in detail. This may be done as class, individually or as a written exercise.

Step 2 Looking closely at the plan now – how do you calculate an average? Well – you total up the numbers first, don't you? And then you can do a division to get the average. So the plan needs to be more like this, with four steps, calculating the total BEFORE the average… PLAN ask for three numbers calculate total calculate average display this information Asking questions about the steps will help guide pupils to a way of constructing the answer. This should be interactive.

Step 3 The first step – ask for three numbers – this is really "read in three numbers". If we do this, where will we store them? In fact do we need to store them? No, we could just add each one directly to a running total, and then discard it. (Note – when reading in a series of numbers, it's always worth asking that question – do I need to store them all, or can I process each one as it comes in and then throw it away?) This allows us to merge the first two steps, so we now have… PLAN read in three numbers, adding them to a total calculate average display this information Talking through a process will reveal further steps that need to be dealth with. In this case, we realise that we need to add to a total.

Step 4 We now have a plan in sufficient detail, let's go ahead and implement it. The first step … read in three numbers adding them to a total … is a repetitive activity, requiring a loop. Q. Is it a fixed loop or conditional loop we need? More questions are used to tease out detail.

Step 5 We're doing something 3 times, and we know this at the point the loop starts to execute, so it's a fixed loop. (Remember, we'd use a while loop when we didn't know at the point the loop starts to execute how many repeats we'd be doing.) Let's add the fixed loop in: Program (in Haggis) FOR step FROM 1 TO 3 DO END FOR Some guidance on the code needed is provided. In the next task the pupil sits, this could be excluded in order to allow pupils to try the approach themselves.

Step 6 Inside the loop we're reading something in, so let's add that Program (in Haggis) FOR step FROM 1 TO 3 DO RECEIVE nextNum FROM KEYBOARD END FOR More steps help the pupil elaborate on the current focus, which is to read in three items of data.

Step 7 And we're adding the number to a running total. Does this look ok? Program (in Haggis) FOR step FROM 1 TO 3 DO RECEIVE nextNum FROM KEYBOARD SET total TO nextNum END FOR And adding in the total helps. Questions about code also help.

Step 8 No – this isn't right, as we're saying that the total will be the number just read in – no adding going on. We want to add the new number to the previous value that was in the total variable. Is that ok now? Program (in Haggis) FOR step FROM 1 TO 3 DO RECEIVE nextNum FROM KEYBOARD SET total TO total + nextNum END FOR

Step 9 Well, it's better, but it'll cause an error, as the variable total has not been created. We do this outside / in front of the loop. What value should total be initialised to? Program (in Haggis) FOR step FROM 1 TO 3 DO RECEIVE nextNum FROM KEYBOARD SET total TO total + nextNum END FOR A lot of alternative conceptions and common mistakes can be dealt with as you develop a solution.

Step 10 Setting a total to zero to start with is sensible. Do you think we've completed the first step of the plan now? Program (in Haggis) SET total TO 0 FOR step FROM 1 TO 3 DO RECEIVE nextNum FROM KEYBOARD SET total TO total + nextNum END FOR We continue to build the program using questions.

The story so far… I hope you get the idea! Note the following: we've been explaining our thinking process at each step – explaining our choices we've posed questions these help keep the reader engaged and active we've shown partially complete artefacts being developed e.g. the plan and then the Haggis program we've referred back to the original problem at times The process here shows how posing equestions and explaining choices builds understanding. To practice, try completing this example.

In summary We should use W.E.s to scaffold (accelerate) development of problem solving templates to avoid a lot of pain!! In summary, Worked Examples are really useful for guiding pupils, allowing them to absorb some of the understanding that we have. It is a form of cognitive apprenticeship that helps develop understanding.

Next steps Incremental Software Development Worked Examples Subgoal Labelling Calculation Worked Examples Incremental Software Development Worked Examples Relational Database Design Worked Examples In summary, Worked Examples are really useful for guiding pupils, allowing them to absorb some of the understanding that we have. It is a form of cognitive apprenticeship that helps develop understanding.