Algorthims Equations Flashcards
Algorithm for catching a bus…?
1 Go to the bus-stop 2 Wait for the bus 3 When the bus arrives, get in the bus 4 Pay for your trip 5 Sit in an empty seat
Organize a friend to pick you up from the airport…?
(TO DO)
Pay for a shirt at the checkout of a department store…?
(TO DO)
Given the ex-GST price of an item, calculate its GST inclusive price…?
(TO DO)
Describe at least one algorithm that would be used by each of the following computer systems…?
- ETFPOS Terminal
- traffic lights
- supermarket checkout
- speech recognition system.
(TO DO)
Algorithms on page 10….?
(TO DO)
Structure diagrams …?
do in book.
Supply an efficient algorithm for sharpening a new pencil (using a mechanical sharpener)…?
1 Insert noneraser end of pencil into hole inside of sharpener.
2 Hold pencil firmly in place with one hand.
3 Turn crank of sharpener with the other hand.
4 Remove pencil for sharpener to check point of pencil.
5 If point is sharp enough, then stop,
6 Else repeat steps 1-4 until pencil point is sharp.
Write an algorithm to add two integers…?
1 Write the integers one below the other, aligning their rightmost digits.
2 If one number has more digits than the other, then
a Insert zeros at the beginning of the smaller number until the integers are of the same length.
3 Draw a line under the lower number.
4 Start with the right most column, called the current column.
5 Add the digit in the current column.
a If the sum is less than ten, then
1. record the sum in the current column, below the line.
b Else
1. Subtract 10 from the sum value.
2. Record the difference below the line
3. Record the value 1 in position above the upper number in the column to the left of the current column.
6 Designate the column immediately to the left of the current column as the new current column
7 If the current column is empty, then
a Stop
b The result is below the line.
8 Else
a Go to step 5
Use natural language to write down each step you’d take to change a tire…?
1 Set emergency break 2 Open trunk 3 Check condition of spare tire 4 Remove spare from trunk 5 Remove jack from trunk 6 Block wheels 7 Remove hub cap 8 Loosen lug nuts slightly 9 Jack up car 10 Remove lug nuts 11 Remove flat tire 12 Install spare tire 13 Tightly replace lug nuts 14 Lower car and remove jack 15 Put all remaining paraphernalia in trunk 16 Head for service station.
SEE ALGORITHMS ON PAGE 22
—– (ANSWERS ON THE NEXT PAGE)