0% found this document useful (0 votes)
10 views

Programming Course 5

The document discusses programming concepts like variables, data types, operators, and more. It defines variables as names that store values and lists common data types like strings and numbers. It also explains operators for arithmetic, comparison, and logic and shows syntax for declaring variables and assigning values.

Uploaded by

cedouiki
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)
10 views

Programming Course 5

The document discusses programming concepts like variables, data types, operators, and more. It defines variables as names that store values and lists common data types like strings and numbers. It also explains operators for arithmetic, comparison, and logic and shows syntax for declaring variables and assigning values.

Uploaded by

cedouiki
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
You are on page 1/ 1

Allowed characters ( [A...Z, a....z ], [1...

9] , _ , $ )

Case sensitive, ex: Mohamed ≠ mohamed

Do not use accents

name of the variable Do not use spaces

Variables Types of variables String Free text, ex: "Hello world ..."

Number Numbers, ex: 1, 2 .... 99...9

Boolean logic, ex: True or False


Value
...etc

Declaration syntax let nameOfVariable : TypeOfVariable ;

let nameVariable1, nameVariable2, nameVariableN : TypeOfVariables ;

Programming
course - SSTech Assignment syntax nameOfVariable = value ;

Reading syntax reading string myText = prompt("Enter a Value") ;

reading number myNumber = parseInt(prompt("Enter a Value"));

+ Addition / String concatenation, Ex: a + b

Operators Arithmetic Operators - Subtraction, Ex: a - b

* Multiplication, Ex: a * b

/ Division, Ex: a / b

Modulus, Divides two numbers and returns the


%
remainder, Ex: a % b

-- Increment number, Ex: a--

++ Decrement number, Ex: a++

Comparison Operators > Greater than, Ex: a > b

>= Greater than or Equal to, Ex: a >= b

< Less than, Ex: a < b

<= Les than or Equal to, Ex: a <= b

== Equal to, Ex: a == b

!= Not equal to, Ex: a != b

Logical Operators && Logical AND, Ex: (5 < 2) && ( 5 > 3 ) ====> False

|| Logical OR, Ex: (5 < 2) || (5 > 3) ====> True

! Logical NOT, Ex: ! (5 < 2) ====> True

You might also like