Saturday, December 20, 2008

At last!

LEARNINGS OF THE WEEK
BY: Sharra Mae S. Tagaro IV- Rizal

This week, we finally met with our teacher after several days of having no class. But we did not tackled any lesson. Instead, we had an activity about the reports of our classmates. As what we did not expect...It was hard but we managed to answer it though... oh! and one thing, we celebrated also our Christmas party...^^,

Learnings of the Week (ROLLORATA)

HAPPY HOLIDAYS! :))

wooh. i guess i really deserve this break.

time out for the (urgh) spellbinding programming lessons.

well, weeks from now, classes will again be resumed and hhhmm.. looking forward to recursion and arrays. haha.

merry xmas! wish Ü all the best this new year, Sir ernz. :]

Monday, December 15, 2008

Learnings of the Week (ROLLORATA)

CONDITIONAL STATEMENTS :]

A conditional statement is a set of commands that executes if a specified condition is true. JavaScript supports two conditional statements: if...else and switch.

if...else Statement

Use the if statement to execute a statement if a logical condition is true. Use the optional elseif statement looks as follows: clause to execute a statement if the condition is false. An

if (condition)
statement_1
[else
statement_2]

condition can be any expression that evaluates to true or false. If condition evaluates to true, statement_1 is executed; otherwise, statement_2 is executed. statement_1 and statement_2 can be any statement, including further nested if statements.

You may also compound the statements using else if to have multiple conditions tested in sequence, as follows:

if (condition)
statement_1
[else if (condition_2)
statement_2]
...
[else if (condition_n_1)
statement_n_1]
[else
statement_n]

To execute multiple statements, use a block statement ({ ... }) to group those statements. In general, it is a good practice to always use block statements, especially in code involving nested if statements:

if (condition) {
statements_1
} else {
statements_2
}

It is advisable to not use simple assignments in a conditional expression, because the assignment can be confused with equality when glancing over the code. For example, do not use the following code:

if (x = y) {
/* do the right thing */
}

If you need to use an assignment in a conditional expression, a common practice is to put additional parentheses around the assignment. For example:

if ((x = y)) {
/* do the right thing */
}

Do not confuse the primitive boolean values true and false with the true and false values of the Boolean object. Any value that is not undefined, null, 0, NaN, or the empty string (""), and any object, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement. For example:

var b = new Boolean(false);
if (b) // this condition evaluates to true

Example
In the following example, the function checkData returns true if the number of characters in a Text object is three; otherwise, it displays an alert and returns false.

function checkData() {
if (document.form1.threeChar.value.length == 3) {
return true;
} else {
alert("Enter exactly three characters. " +
document.form1.threeChar.value + " is not valid.");
return false;
}
}

switch Statement

A switch statement allows a program to evaluate an expression and attempt to match the expression's value to a case label. If a match is found, the program executes the associated statement. A switch statement looks as follows:

switch (expression) {
case label_1:
statements_1
[break;]
case label_2:
statements_2
[break;]
...
default:
statements_def
[break;]
}

The program first looks for a case clause with a label matching the value of expression and then transfers control to that clause, executing the associated statements. If no matching label is found, the program looks for the optional default clause, and if found, transfers control to that clause, executing the associated statements. If no default clause is found, the program continues execution at the statement following the end of switch. By convention, the default clause is the last clause, but it does not need to be so.

The optional break statement associated with each case clause ensures that the program breaks out of switch once the matched statement is executed and continues execution at the statement following switch. If break is omitted, the program continues execution at the next statement in the switch statement.

Saturday, December 13, 2008

No Class pa rin!

LEARNINGS OF THE WEEK
BY: Sharra Mae S. Tagaro IV- Rizal

This week, we had no class because the teachers again were so busy...But we were tasked by our teacher to study the reports of our classmates in our activity last week..And so I still learned a bit with the help of my classmates explaining it to me..That's all!^^,


Saturday, December 6, 2008

No Class...

LEARNINGS OF THE WEEK
BY: Sharra Mae S. Tagaro IV- Rizal

This week, we still did not have a class with our teacher but we continued reporting our assignments in programming... ♪♪♪

Learnings of the Week (Rollorata)

Another HOLIDAY! hehe :)

this week was not that complicated because only few teachers went to our class to have their regular class discussion.

People were busy for the TEACHER'S DAY!

and Sir Ernie was one of the dancers of our school. Wooh. Yey! :]

maybe next week, we'll be back to torture, oh i mean, class again. hehe.


(",)