Tuesday, August 30, 2011

GUESS MY NUMBER PAGE

31.08.11.

Today we learnt how to work on the script for them guess my number page.
In this photo I have changed the colour of the background to purple and the limit number to 1000 instead of 100.

Thursday, August 18, 2011

Monday, August 8, 2011

SELECTION AND REPETITION

Algorithms are composed of three basic structures- This includes, Sequence, Selection and Repetition. Algorithms' process of making decisions are called Selections.

Examples-

MOVING THROUGH A SET OF TRAFFIC LIGHTS
If stoplight is green, continue driving.
If stoplight is yellow, while approching slow down to stop.
If stoplight is red, when approaching stop.

DECIDING WHETHER TO TAKE AN UMBRELLA TO SCHOOL
If it is raining outdoors, take the umbrella
If it is sunny and not raining, dont take an umbrella

GIVING A STUDENT AND 'A', 'B', 'C' ON THEIR TEST
If student receives 95% or above, result is an A
If student receives 75% or above, result is a B
If student receives below 75%, result is a C.

When an algorithm rewuires you to repeat a task in order to solve the problem, this is called "REPETITION"

EXAMPLES-

ADDING THE CORRECT AMOUNT OF CORDIAL TO MAKE A DRINK
  1. Fill a jug with 1/4 of a cordial mix.
  2. Fill the jug with 3/4 of water.
  3. Repeat steps 1 & 2 to make the appropriate amount of cordial.
FILLING A BUCKET WITH WATER
  1. Fill a jug with water from a tap.
  2. Pour the water into the bucket.
  3. Repeat steps 1 & 2 until bucket is full to your choice.
BLOWING UP A BALLOON
  1. Use a pump and put the opening of the balloon with the nozzle of the pump.
  2. Push the pump up and down.
  3. When filled with air, of your choise tie the opening of the balloon.
  4. Repeat steps 1 -3 with some more balloons.

Tuesday, August 2, 2011

ALGORITHMS

It is an unambiguous set of steps, at which wehen performed correctly by a proffesor will result in a process being carried out in a finite time.

Example- Algorithm when explaining to someone how to make a cup of coffee-
  1. Boil the water
  2. Place coffee in the cup
  3. place sugar in the cup
  4. add the boiling water
  5. add milk
  6. And stir
The most important part of an algorithm is the way the steps are pleaced in order. It is very important that this is done the right way as the rest of the sequence is reliant to it. For example if steps 2 and 6 were swapped there will be a certain variable that will limit the steps to be done, or the end product will not be the same. in this example, if stirring and placing the coffee in the sup were swapped, and individual will then be stirring an empty cup. Steps aklso should have a finite number of steps, so that the algorithm will end when the goal is reached. They should be short, simple and straight to the point.

Here are some examples-

POSTING A LETTER
  1. Write the letter to whom it may concern.
  2. Fold the sheet of paper/letter to the appropriate size that it should fit into the envelope
  3. Place the letter in the envelope. Then write the address of where it should be sent to on the back of the envelope.
  4. Seal the envelope.
  5. Find your nearest Post office, and buy the appropriate postage stamp for your letter.
  6. Stick/Paste the stamp on the top right hand corner of the envelope.
  7. Place letter in the postbox.
MAKING TOAST
  1. Place the appropriate amount of toast in the toaster. (Amount may depend on your choice, or how much the toaster can fit.
  2. Adjust toaster setting according to the usersneed and choice of how the bread is cooked.
  3. Push the lever on the side of the toast down.
  4. When toasts "pop up". Put the desired spread on the toast accroding to your taste.
  5. Eat and enjoy !
CALLING A FRIEND ON THE PHONE
  1. Search the phonebook for the desired friend to call.
  2. Press green button showing a "phone" image on the left hand side of the phone.
  3. Make sure the phone is ringing. And wait.
  4. When friend picks up, start your conversation.
  5. When finished press the red button on the right hand side of the phone.