video

Lesson video

In progress...

Loading...

Hi, I'm Rebecca you're computer teacher for "Programming Part One." For this lesson, you're going to need your replica cam that you should have already set up in lesson two with your parent or carer's permission.

You're also going to need a pen and paper, and possibly a ruler 'cause you're going to be drawing some flowcharts in this lesson.

It's also a really good idea to try and remove as many distractions as you can so that you can really focus in this lesson.

Once you've got all of that ready, we can begin.

In this lesson, you will identify flowchart symbols, and describe how to use them.

You'll translate a flowchart into a programme sequence, and you'll design a flowchart for a programme.

Think about this then.

This is a flowchart.

A flowchart can be used to visually represent an algorithm or programme.

And I've got a question for you.

What do you think will happen when this flowchart is executed as a programme? Pause the video while you think about that.

Let's take a look then.

The code will output "Hello world!" on the screen for the user.

Flowcharts are used when designing programmes.

They should be clear and precise just like your code.

Flowcharts are read from top to bottom.

Here is this flowchart as a programme.

Start will be executed first as it is the main programme.

Terminators or those oval shapes, are used to show the start and end of the programme or subroutines.

Arrows are used to show the flow of the programme.

The arrowhead represent the direction of the flow.

Welcome is referring to a subroutine call.

A subroutine call is represented by a rectangle with two lines at each side.

The subroutine is then executed.

Subroutines are created in separate flowcharts that are linked by a name and symbol.

An output is represented using a parallelogram.

This symbol is also used for inputs.

At the end of the subroutine, it will return to the main programme.

The same thing happens with your flowcharts.

The main programme will then resume or in this case it will end.

So let's just recap.

We've got there a start symbol, should also be used for stop.

And these are terminators.

You've got arrows and they're used to show the direction of the flow of the programme.

Then you've got subroutines and these are represented by a rectangle with two lines, either side.

And finally, you've got an input or output, which is represented by a parallelogram.

There are many more symbols that can be used with flowcharts, which will be introduced in the coming lessons.

You're going to have a go at interpreting a flowchart now.

And you're going to use the worksheet to help you do this.

So use the translate a flowchart to write a programme section of the worksheet, to help guide you through the activity.

We're going to have a go at doing this afterwards.

So if you get a little bit stuck along the way, you can always come back here and watch me have a go.

Pause the video while you have a go.

Excellent.

Let's look at the solution then.

Watch the demonstration to see how you could have translated the programme.

Off we go.

So I'm going to work through that flowchart now and translate it into a Python programme.

Now the great thing about flowcharts is that they're already in a sequence.

So we just need to follow that sequence through and translate each symbol to our Python code.

So I'm going to start at the beginning.

And the start is obviously where the symbol says "Start", and that's at the top.

Now, you don't write the words start in Python so I can always just ignore that because I know that that's at the beginning.

The next thing says "Output: Hello, "my name is Susan from Space." Now, I know how to output onto the screen, I need to use the print statement.

So I'm going to do print, and then it says, "Hello, my name is Susan from Space." There we go.

So now I've done that first symbol, so I can press the Enter key and move on to the next one.

It says, "Output: What is your name?" So it's just the same thing again, write another print.

What is your name? Question mark, and there we go.

So that's my next symbol.

The third symbol says "Input: Name." Now, if I want to use that name somewhere else, then what I've got to do is I'm going to have a variable called name.

So I'm going to put name, and then I'll generally do equals and input.

And because name is string, I'm just going to leave it like that, I'm not going to wrap it into anything like that around it, I'm just going to leave it as it is.

So that's four symbols down.

So now I'm looking at the next one, it says "Output: Hello name, "I am from the year 2210, "and I am 20 years old." So now what I need to do is I've got to use an f-string, and I've got to use those curly brackets.

And there was a little clue there in the outputs symbol, because it does have the curly brackets there.

It just doesn't have the f.

So I've got to do print, and then I put my f like so, and then hello: Name, and then a full stop.

I am from the year 2210, and I am 20 years old.

And there we go.

So I'm done with that one.

Now at this point, I could actually test my programme.

And it's a good idea to test as you go along.

So I'm going to test it now.

So I'm going to run it and just make sure it does it.

Hello, my name is Susan from Space, what is your name? I'm going to put Rebecca.

Hello, Rebecca, I am from the year 2210, and I am 20 years old.

So I know that that part is working.

I've got no syntax errors at this point to fix, so I can keep going.

Whoops! On this one, so I'm going to press the Enter key.

So, now it says "Output: How old are you?" So again, another print, how old are you? Okay.

And then it says "Input: Age." So just like I did with the name, I want to create a variable called age.

And I want to input the age.

Now the difference with this one is I want to be able to hold that as a whole number.

So I'm going to have to use the integer as well.

So around that input function, I'm going to have to wrap around that integer function as well, so that it holds it as an integer and not as string.

So there we go.

So that's that one.

And then the next one says, it's a process box, it's saying: "Future age=age+2210-2020," 'cause that's the year I'm currently in.

So if you weren't in 2020, you might want to change this to a different year.

If you're, maybe you were in 2021 or 2028, who knows, whatever your year you're in, you could put that year in.

So I'm just going to put future age, and then, age plus 2210 take away 2020.

And just make sure I've got my brackets right.

And it's a good idea to have a space as, oh, not an Enter key, a space there.

So future age equals age plus age plus 2210 take away 2020.

And then you just put the current year there, okay? Now I'm going to put, It says: "An output" at this point.

So, I'm going to do print, and the output includes a variable.

So I need to put the f in there 'cause it's an f-string.

So f.

So while, by 2210, you will be, and then future age.

And then a comma, that is really old, like so, okay? And again, I can test my programme at this point, 'cause I've done quite a few lines now.

Try and do it every one, two or three lines when you're testing it.

So what is your name? Rebecca.

My age, of course, I'm 22.

So I'm going to put that.

Wow, in 2210, you will be 212, that is really old, okay.

And I've just realised that I've made a spelling mistake.

So it's a good idea to test your programmes 'cause then you can spot the spelling mistakes.

And I've made one there.

I'll put two L's in will.

So there we go, just fix that.

So, now I can move on to the next one.

It says: "Output: What music are you into?" So again, just a normal print this time, what music are you into? And then got input music this time.

So another variable and it's string, so I can keep it as that.

Oops! And then, I've got the last one output: I have not heard of, and then in the curly brackets, music.

So I've got to display a variable.

So I need an f-string again this time.

So print f, and then I have not heard of music.

And then just making sure I've got that speech mark again at the end.

And the last, the final symbol is just end so I know that that just means I can stop there.

So now I can test it one more time.

So what is your name? Rebecca.

How old are you? 22.

What music are you into? Pop.

I have not heard of pop.

So now I know it's working.

There's no syntax errors.

And I've done exactly what I should have done, I've translated that flowchart.

So if you weren't sure how to do it, then you can just rewind this video and code along with me.

For the next activity, you will be designing your own flowchart.

You can use any of the following options to design a flowchart.

So just pen and paper is fine, or you could do a Google slide or a PowerPoint slide, turn to portrait, and then you can drag in the blocks that you need.

And then the final one is some free software called Flowgorithm, which is what I've used to draw my flowcharts with.

And it is a good tool.

It's free to download and it's open source.

But if you are going to download and instal that on your computer, you will need to ask your parent or carer's permission.

So what you're going to need to do is look at the worksheet and use the design a flowchart section to help guide you through the activity.

Now I'm going to show you the solution after this screen.

So try and work independently, thinking that through and try your absolute best.

And then you can come back and you can check on what the solution should be afterwards.

So pause the video now while you have a go.

Excellent.

So, here's the solution then.

So, it was quite a tricky one.

It gave you a tricky Mystical Meredith maths challenge.

And it's quite a common maths game where you try and do a bit of a magic trick with maths.

So it might've taken you a little while to get the order.

And hopefully that final slide there with the bullet point list would have helped to check it through.

But what you can do now is you can just pause the screen and just check your flowchart against the solution that's there on your screen.

Fantastic.

So, let's just have a quick reminder and a quick quiz, just to see if you can remember what these symbols do.

So, pause the video while you write down what these symbols do.

Let's look at the answers then.

So, the first one was a terminator.

And this is to symbolise the start or the end of the flowchart.

You've then got a subroutine call.

And this is used to symbolise a change of flow in execution to a subroutine.

And then finally, you've got the input or output symbol.

And this is to symbolise data being input or displayed for the user.

That's everything this lesson then.

So now, you know, a lot about flowcharts and how to actually draw them and translate them into your own programmes.

And then think about the progress as well that you've made throughout the whole unit of this part one of the programming unit.

So you've gone all the way from doing no Python code at all, to create in your own programmes, using input, using the variables, using subroutines.

You know about datatypes.

So you've covered an awful lot in this unit.

Now, the next unit that you would do after this one is "Programming Part Two." So if you're interested in carrying on your learning, then that's a good unit for you to have it go at.

And if you'd like to, please ask your parent or carer to share your work on Instagram, Facebook or Twitter, tagging @OakNational and #LearnwithOak, if you'd like to share the flowchart that you've made in this lesson.

And hopefully, I'll see you again for part two.