Hello and welcome.
In this video I will explain what statements are in computer programming.
What is a statement.
Computer language statement basically is a group of words numbers operators that performs a specific
task.
Now this group of words could also include things like comments comments are basically a way of explaining
various parts of your computer code.
So if statements is a combination of words numbers operators and the various components that the programming
language needs to create a program.
So the various components of a statement can include values.
Values are like the data that the computer program needs to function.
For example a value could be a number.
It could be a text which In programming terms is referred to as a string.
It can also be expression.
It could also be operators like a plus operator minus operator.
Those are known as operators could be a keyword like var could be comments.
So these are various components that you can have in a statement when the computer program runs it looks
at the statements in the code and a runs or executes from top to bottom left to right one by one just
to where you hopefully read the book from top to bottom computer programming is executed or runs the
computer programs from top to bottom and from left to right.
So usually the order is executed in the same order in which the statement is read written in computer
programming to run the program means to execute a program a statement is just like a sentence in English
language and just like in sentences you can have different components that make up the sentence.
A typical computer program will consist of multiple statements I have opened up a blank web page and
the web page is caught about column blank.
So if you type this in to your web browser and just press enter it will give you a blank page.
So what you gonna do is going to access the developer tool console so to do that if you just right click
click on inspect and click on console.
And that would give you the console era.
So in this area here we can play around and experiment with some javascript code.
So I'm going to write a very simple javascript statement so I'm gonna say a a to
b times seven this is a complete statement even though it's simple it's a complete statement.
Just like in the English language you can end your statement with a full stop in some programming languages.
They have different punctuation depending on their language in JavaScript.
You typically end your statement with a semi colon.
So this is a typical valid statement in JavaScript.
Let me quickly run through the statement with you.
The characters a and b are called variables variables are basically like simple boxes that you can use
to store any of your stuff in in computer programming you can use variables to store data okay in programs.
Variables are used to hold values of value could be a number like 7 and the values are things or data
that the program will use.
So you can think of variables as a symbolic place holders for the values that they contain.
Now this number 7 here is basically is a value in itself and it's called a literal value.
This is because it stands alone without being stored in a variable.
The course to this asterisk here.
Both characters are called operators.
They are used to perform actions with the values and variables such as an assignment and math.
Mathematical multiplication.
This equals two is known as an assignment operator.
And this asterisk is known as a multiplication operator.
So basically what this is doing here is saying that a is a course to the value of b times 7.
All right.
So once you get the value of b times it by seven and story back in a.
That's basically what that statement is saying.
There are different types of operator.
This is just one that I have illustrated with now most statements in JavaScript and or are concluded
with a semicolon at the end.
This it's specific to JavaScript or other languages have different syntax requirement.
So this statement K caused B times 7 basically tells a computer to get the current value that is stored
in the variable B.
Multiply that value by 7 then store the result back into the variable we call a.
That's what this statement is saying.
So programs are just a collection of many statements which together describe all the steps that it takes
to perform a computer program.
So you may have a basic program for example that adds numbers together so the various steps that you
have to specify for the computer to follow.
They are collectively referred to as statements.