Fourt Quarter Reviewer

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Fourt Quarter Reviewer: (TLE 10 – COMPUTER PROGRAMMING)

Expression and Operators

Operands - Variables and literals contained in an expression.


% (modulus) - Operator used to divides two operands and returns the remainder.
= - Assignment operator which assign the value of the right operand to the left operand.
Expression - A sentence with a minimum of two numbers or variables and at least one math operation.
Operators - Are symbols used in expression to manipulate operands.
Arithmetic - Used to perform mathematical calculations, such as addition, subtraction, multiplication and division.
Assignment operator is used for assigning values to a variable
+= Operator that adds the value of the right operand to the left of the operand and assign the new value to the
left operand.
What is the only one operator used to perform string concatenation? + (plus sign)
parseFloat() - Data conversion commands used to convert string literal to floating-point numbers.
toLowerCase() - Data conversion commands used to convert the specified text string to lowercase.
toUpperCase() - Data conversion commands used to convert the specified text string to uppercase.
parseInt() - Data conversion commands used to convert string literal to integer numbers.
Math.round() - Math related commands that returns the of x, rounded to the nearest integer.
Math.random() - Math related commands that returns a random number between 0 and 1.
&& - Operator that returns TRUE if both left operand and right operand returns a value of true. Otherwise, it returns a
value of false.
Null - A container to which you assign a name for a value in the memory of the computer running JavaScript.

Decision Making in JavaScript

comparison - This operator are used to compare two operands for equality and to determine if one numeric value is
greater than the other.
What is the Boolean value if the two operands are equal? – FALSE
Logical - Used for comparing two Boolean operands for equality.
Boolean - This data type can only have two values, True and False

Controlling Program Flow in JavaScript

Sequence - A control structure that shows an action sequentially followed by another action.
Selection - A control structure that tells the program which action to perform, based on a certain condition.

If statement, If else, Nested If, Switch and using loop

What is the purpose of the switch statement in JavaScript?


-To execute a block of code based on a condition.

How do you specify the condition for a switch statement?


- By using the switch keyword.

How do you specify the code to be executed if none of the cases match the condition?
- By using the default keyword.

What happens if you omit the break statement in a case block?


- The code execution continues to the next case block.

Can you have multiple case labels for a single block of code? Yes, it is possible.

The correct syntax for a switch statement - switch (condition) {...}

Top to bottom - order does the code execution flow through the switch statement.

data types that can be used as the condition for a switch statement – (Number, String, and Boolean)

How do you exit a switch statement before reaching the end of the block? By using the break keyword.

What statement is used if the conditional expression evaluated by the if statement returns a false value? If else
switch statement - A control program flow, executing a specific set of statement, depending on the value of an
expression.

loop statement - A repeatedly executes a statement or a series of statements while a specific condition is true or until
a specific condition becomes true.

while statement - Used for repeating a statement or series of statement as long as the given condition statement is
true.

Can you use expressions as case labels? Yes, it is possible.

How many default cases can you have in a single switch statement? Only one.

Which statement is executed if no case matches the condition and there is no default case? No statement is executed.

Can you nest switch statements within each other? Yes, it is possible.

default - keyword is used to define a default case in a switch statement in JavaScript?

-----------------------------------------------------------------------------------------------------

Array

array - A set of data represented by a single variable name.

<INPUT> - It defines an input field where the user may enter information on the form.

TEXT type - Produces a single line text entry. It allows user to enter character data.

The PASSWORD type is a lot like text. They share all the same attributes, except that any characters typed into the
box are hidden.

Check box - Allows the user to select one or more options from a set of choices.

Radio buttons - This element is used to display a list of options just like checkbox.

The Reset type creates a button on the screen that clear the form and returns all the settings to their original default
values.

Function

Function - Consists of a group of statement that perform a single task and is placed under one name.

You might also like