simply me & what I do in IST...
no taxing aiights. :)
cos i have machine guns! xD
02.05.95
cmac10'ster.
[EST. 210307]
i❤youuuu.
&& thats me.
This is a part of a new term's worth of work on Software Development. We start off learning about algorithms which this entry is focused on then selection and repetition and then starting work using Visual Basic.
What is an Algorithm?
An unambiguous set of steps, which when performed correctly by a processor, will result in a process being carried out in a finite time.
Example Algorithm:
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. stir.
1. Examine the algorithm above. What two properties of the algorithm enable it to correctly describe the solution to the problem of making a cup of coffee? What is it that makes an algorithm correct?(Hint: what would happen if you swapped step "6" and step "2"?)
The two properties that enable an algorithm to be correct are the order it's in and the description of each step. For example if steps 6 and 2 were swapped the end result after completing all the steps would not be the same as the original algorithm and can also taste very different to what one would hope. Therefore this reinforces that an algorithm is a set of steps and when in the correct order, correctly define the end result.
2. Define Algorithms for the following processes.- Posting a letter
- Making toast
- Calling a friend on the phone
Posting a letter:
1. Write the letter
2. Enclose the letter in an envelope and label and stamp it
3. Go to the nearest post office or post box
4. Slip letter into post box
Making toast:
1. Take out the number of slices of bread you want
2. Go to the toaster
3. Slip one slice of bread into the available slits
4. Set to what degree/time you want to toast to and turn on
5. Wait until cooked and the toast pops up
6. Collect toast and repeat steps 3 to 5 if more slices are to be toasted
Calling a friend on the phone:
1. Prepare the number you're going to dial
2. Pick up phone
3. Dial in the phone number
4. Wait for call to connect after dial tone
5. Speak when call is answered or when prompted to by answering machine
Tatjana's Blog: Tatjana in IST.