Sunday, November 16, 2008

What a quiz!

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


This week, we had a surprise quiz parallel to our activity last week. Although it was just parallel to our activity last week, it took time for us to figure out how to answer it. But in the end, I ended up giving the wrong program to run.. : (...

Learnings of the Week (Rollorata)

QUIZ TIME!

This time, i was still out because of the quiz bee i attended to. my classmates told me that they had a quiz that was parallel or similar with the problems they reported. Only few of them got the program right.

Saturday, November 8, 2008

Third gradinG na!!!

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


This week, we started our third grading with an assignment on programming, specifically on iterative statements which is to be reported the other day in a manila paper. I was so nervous because our problem is so difficult and there was only the two of us left to make the assignment and that we almost gave up. But because we tried our best and we asked the help of our subject teacher, we made it and I was able to present and explain it in front of the class.What a relief...
This was our assigned problem and answer:
Write a program that will display the following pattern, give the value of n.
So this was the program we run:
#include
#define p printf
#define s scanf
main()
{
int f,q,x,y,t;
clrscr();
p("Enter number:");
s("%d",&x);
p("If n=%d,output\n");
p("\n\n");
q=x;
f=1;
for(y=1,y<=x,y++)
{
for(t=f,t<=q,t++)
{
p("*");
}
p("\n");
q--;
}
getch();
}
The result of this program will look like this:

Enter number: 4

If n=4, output

****

***

**

*

Learnings of the Week (Rollorata)

THIRD QUARTER!

This week, i was out from the class because of an intensive review for the upcoming Regional Math Quiz Bee, yet, i still have the time to ask my classmates what they did in our Computer Class. They had their reporting on computer programming and i found the problems hard. our group's problem was to Write a program that will display the following pattern, give the value of n.

****

***

**

*

This was the program that we ran:

#include
#define p printf
#define s scanf
main()
{
int f,q,x,y,t;
clrscr();
p("Enter number:");
s("%d",&x);
p("If n=%d,output\n");
p("\n\n");
q=x;
f=1;
for(y=1,y<=x,y++)
{
for(t=f,t<=q,t++)
{
p("*");
}
p("\n");
q--;
}
getch();
}

The result of this program will look like this:

Enter number: 4

If n=4, output

****

***

**

*

Sunday, October 26, 2008

LEARNINGS OF THE WEEK (TAGARO)

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

We had our second grading examination last October 24. And I'm not confident that I will gain a high score because there were items in the test that I had a difficult time answering.

Before the day of our examination, we had an activity about programming. I was able to run my program but I was not able to get the perfect score in the rubrics because the answer of my program is incorrect.What a pity..

Saturday, October 25, 2008

Learnings of the Week (ROLLORATA)

This week, we started making our business plan.It really takes time and effort to make such. And so teamwork and cooperation is a big help.
That's all!

Sunday, October 19, 2008

Learnings of the Week (ROLLORATA)

ITERATIVE STATEMENTS

Iterative statements (loops) allow a set of instruction to be executed or performed several until condition are met. It can be predefined as in the loop, or open ended as in while and do-while.

Types of Iterative Statements

The For statements

The While statements

The Do-While statements

The For statements

The For statement or for loop is considered as a predefined loop because the number or times it iterates to perform its body is predetermined in the loop’s definition.

The For loop contains a counter whose values determine the number of times the loop iterates. The iteration stops upon reaching the number of times specified in the loop.

The general form of the for statement is:

for (initialization; condition; increment)
{
statement_sequence;
}

Where:
l for is a reserve word in C
l Initialization is an assignment statement that is used to set the loop’s counter.
l Condition is a relational boolean expression that determines when the loop will exit.
l Increment defines how the loop’s counter will change each time the loop is separated.
l Statement sequence may either be a single C statement or a block of C statements that make up the loop body.

l The for loop continues to execute until the condition is True (1).
l Once False (0), program execution resumes on the statement following the for loop.

Note:
l Never place a semicolon right after the for header.
l Never change the value of the for loop’s counter in side the body of the loop. This will affect the result of the program.
l The increment part of the for loop is execute after the first iteration of the loop.

The While statement

The while statement or while loop is an open-ended or event-controlled loop.
The while loop iterates while the condition is TRUE (1).
When it becomes FALSE (0), the program control passes to the line after the loop code.

The general form of the while statement is:

while (condition)
{
statement_sequence;
}

where:
l While is a reserved word in C
l Condition is a relational expression that determines when the loop will exit.
l Statement_sequence may either be a single C statement or a block of C statements that make up the loop body.

The Do-While statement

The second type of open-ended or event-controlled loop is the do-while statement or do-while loop.
The general form of the do-while statement is:
do
{
statement_sequence;
} while (condition);

Where:
l While and do are reserved words in C
l Condition is a relational expression that determines when the loop will exit.
l Statement_sequence may either be a single C statement or a block C statements that make up the loop body.

Do-While is a variation of the while statement which checks the condition at the bottom / end of the loop.
This means that a do-while loop “always executes at least once”.
In the do-while loop, when the condition evaluates to TRUE (1), the loop body will be executed, but when FALSE (0), program control proceeds to the next instruction after the do-while loop.