Sunday, January 18, 2009

FUNCTIONS. FUNCTIONS.
by: Mary Trishia V. Tabigue
This week, we discussed FUNCTION and FUNCTION CALL.
The function call is the one that calls the function in doing it's specified tasks.
Also, we discussed actual and formal parameters.
And, to test wahat we've understood, we had a series of computer activities regarding these lessons.
LEARNINGS OF THE WEEK
by: Mary Trishia V. Tabigue
OMG.! QUIZ.?
gosh. it whirrled my mind. tsk3.
I made the WRONG program. a VERY wrong one.
hehe. :(
so sad. because, I think only some of my classmates got the right program.
How I hope I could also get that SOMETIME. :)
I'm really practicing alot now at home. :)
WISH of LUCK to me.!

Saturday, January 17, 2009

ArrAys..

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

This week we had a short discussion of arrays.


*ARRAYS
-
it is a collection of variables of the same data type that is referenced by a common name.

The general form for an array declaration is as follows:

type array_name[size];

Where:
*type is any valid data type in Turbo C which declares the type of values that array will hold. *array_name is a valid variable name which will name the array.
*size defines how many elements the array will hold.

l
l->The two declarations for arrays number and answer can be combined into a single declaration:
int number[100] , answer [25];

->Arrays can give initial values during the declaration.This is called array initialization.


int Array1[5]={25,5,7,11,163};


And by the way...we had already taken our third periodical exam..That's all!


Tuesday, January 13, 2009

Learnings of the Week (ROLLORATA)

[ ARRAY ]

In computer science, array programming languages (also known as vector or multidimensional languages) generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays.
  • An array is a variable name that is associated with a number of adjacent locations in RAM.
  • If the name of the variable is, for example, StudentQuizScores, individual values within the array are accessed via an array index, or just index using a syntax something like:
     StudentQuizScores[i]
    which means the i-th element/value in the array "StudentQuizScores".
  • The array name plus index notation is treated just like a regular variable in the programming syntax. E.g.,
     StudentQuizScores[i] = StudentQuizScores[i] + Quiz4Score;
  • Depending on the particular programming language, the index associated with the very first element in an array might have the value 1 or 0 (most modern ones use 0).

Saturday, January 10, 2009

Recursion

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

This week, we had a brief discussion of recursion:

*RECURSION
- defined as the repetitive process by which a function calls itself. It is also termed as the CIRCULAR DEFINITION. Recursion is also a programming technique where a routine performs its task by delegating part of it to another instance of itself.

For example in this program segment:

Factorial (int n)

{

If (n==1||n==0) return 1;

else return (n * factorial (n-1));

}

In this program segment, it illustrates a function containing a call to it. The lines else return (n * factorial (n-1)); contains the function call for the factorial function.

The parts of the recursive function include the Base Case. The base case can be found in the “if clause”. It contains the condition that should be satisfied at one point of execution to terminate the repetitive process done be the recursive function. And the other part of the recursive function is the General Case. The general case can be located on the “else-clause”. It contains the function call of the recursive function to itself.

The Direct Recursion is a recursive functions that can call itself through a function call directly inside the body of the function. While the second type of recursion is the indirect recursion. The Indirect Recursion is a recursive functions that can call another function outside its function.

And we had an activity in programming about it...that's all!^-^,.

Learnings of the Week (ROLLORATA)

RECURSION <---
Recursion is a programming technique that allows the programmer to express operations in terms of themselves. In C++, this takes the form of a function that calls itself. A useful way to think of recursive functions is to imagine them as a process being performed where one of the instructions is to "repeat the process". This makes it sound very similar to a loop because it repeats the same code, and in some ways it is similar to looping. On the other hand, recursion makes it easier to express ideas in which the result of the recursive call is necessary to complete the task. Of course, it must be possible for the "process" to sometimes be completed without the recursive call. One simple example is the idea of building a wall that is ten feet high; if I want to build a ten foot high wall, then I will first build a 9 foot high wall, and then add an extra foot of bricks. Conceptually, this is like saying the "build wall" function takes a height and if that height is greater than one, first calls itself to build a lower wall, and then adds one a foot of bricks.

Monday, January 5, 2009

Learnings of the Week (ROLLORATA)

ITERATIVE STATEMENTS Ü

Three types of iterative statement are provided: the for-statement providing definite iteration and the while- and repeat-statements providing indefinite iteration.

Iteration may be performed over an arithmetic progression of integers or over any finite enumerated structure. Iterative statements may be nested. If nested iterations occur over the same enumerated structure, abbreviations such as for x, y in X do may be used; the leftmost identifier will correspond to the outermost loop, etc.

Early termination of the body of loop may be specified through use of the `jump' commands breakcontinue. and

Definite Iteration

for i := expr_1 to expr_2 by expr_3 do : ->
The expressions in this for loop must return integer values, say b, e and s (for `begin', `end' and `step') respectively. The loop is ignored if either s>0 and b>e, or s<0 s="0" k="0,">0) or b + k.s>e (for e<0).>

If the required step size is 1, the above may be abbreviated to:

for i := expr_1 to expr_2 do : ->
for x in S do : ->
Each of the elements of the finite enumerated structure S will be assigned to x in succession, and each time the statements will be executed.

Indefinite Iteration

while boolexpr do statements end while : ->
Check whether or not the Boolean expression has the value {true}; if it has, execute the statements. Repeat this until the expression assumes the value {false}, in which case statements following the end while; will be executed.