Variables
When coding certain variables are accessible from different areas of the program, this is called scope. Global scope means that the variables can be accessed and edited from anywhere in the program. Local scope means that it is limited to where it was declared and a couple examples would be inside functions and inside brackets after an if statement.
The AND, NOT, and OR operators are logical operators because when one is used in a statement and if it isn't a boolean then it is covered to one. For example if one boolean is true and another is false then if you were checking if one and two were true then it would be in the end false since one of them is false.
Statements
Assignment statements are when a variable is being assigned a value. The variable must be declared to assign it a value and the value must be the correct datatype or be casted to the correct datatype.
An input statement is how a program receives information from a input device and an output statement is how the program will send the data to an output device.
No comments:
Post a Comment