Login

Please fill in your details to login.





s5cs21 algorithm development techniques

In this section, we look at the big picture of programming. Tying together all the work we have done so far on programming and looking also towards more advanced topics that we have yet to meet.
image
In this section, we look at the big picture of programming. Tying together all the work we have done so far on programming and looking also towards more advanced topics that we have yet to meet.

We are learning ...
#- To recognise each part of the big programming picture
#- About standard programming concepts
#- How to draw flowcharts and represent algorithms in other ways
#- About professional code structure
#- How to check that your algorithm is running correctly.
#- How to become a good programmer!

So that we can ...
#- Consider each part of the 'big picture' when we are preparing to code
#- Use the standard coding constructs with confidence
#- Communicate algorithms to other people / programmers
#- Code in a professional and clear manner
#- Be confident that any algorithm we develop will run correctly.
#- Become a good programmer!

image
This is all you need to know!

Activity 1
The BIG Picture!
Here is a really big picture ...
image
Click to view in new tab
The image shows most of the software development tools which you will use during your time as a fledgling computer programmer. You should see some of the things we've learnt about before plus some new stuff.

time limit
Task 1.1 RAGtime!
Your teacher will provide you with an A3 copy of the "Big Picture"!

Spend 10 minutes, silently reviewing / reading / watching this diagram. You should use Red, Orange and Green highlighter pens to 'RAG' the diagram to focus you on some areas which you will need to find out more about in the future.

Now use your course textbook to research your RED areas. Work in groups if you wish - it will help to discuss the concepts laid out here. DO NOT use the computers to do this. Use the textbook.

OUTCOME Considerably highlighted picture plus a list of areas which are green, a list which is orange and a list which is red (these are the really important ones for you to focus on!)

Checkpoint
[o c:"It's time to take your work to your teacher!"]
Activity 2
Standard programming concepts
There are certain, basic programming concepts that you must be familiar with at this point (if you aren't, I'm really surprised you've made it this far) ...
image
Note that these are general constructs - they may NOT be available or look like this in the programming language you have been learning ...
In terms of modelling skills which you may have experienced at this stage, and definitely in a particular order ...
image
Click to view

time limit
Task 2.1 Push your limits
For each of the standard programming concepts and the modelling skills listed above, try to find or develop at least one example for each one. However, don't push yourself beyond your previous experience - if you don't recognise a concept DO NOT research it.

It's interesting to see where you are now so that you can plan where you are going to go next.
image
OUTCOME : Practical examples of the skills you know now plus an appreciation of the journey you are on.

Checkpoint
[o]
Activity 3
What is an algorithm?
Our friend Google defines the term algorithm as ...
image
Click to view
We could summarise this as...
An algorithm is a set of unambiguous instructions forming a precise, step-by-step method for converting inputs into outputs in order to solve some problem.
A good algorithm must exhibit the following characteristics :

#1 A particular set of input values must produce the same output each time the algorithm is run;
#2 The answer for any particular input must be correct;
#3 The algorithm must stop/halt after a finite number of steps;
#4 The amount of memory used must be minimal (space complexity).
#5 The amount of time used must be minimal (time complexity).

Without these qualities, an algorithm simply will not do.

time limit
Task 3.1 Researching algorithms
You have probably seen an algorithm for the FizzBuzz game, or even played this in maths.

image
Click to view

Play this game with a friend and, when you are satisfied that you understand how it works, research 5 programmed solutions using the Rosetta Code website. For each programmed solution, you should try to identify how each part of the programmed solution relates to the algorithm itself.

image
One Algorithm : Many Solutions

OUTCOME : 5 different programmed solutions to FizzBuzz plus an analysis of each program to identify how it represents each part of the algorithm. You should present your analysis in an inventive way.

Checkpoint
[o c:""]
Question we must ask at this stage are ...
image
Activity 4
Communicating algorithms
There are three common ways to communicate algorithms ...

Structured English
#- A limited highly restricted subset of English language statements
#- No mathematical operators!
#- Represents logic, not mechanics

Pseudocode
#- Similar to structured English
#- Mathematical symbols abound!

Flowcharts
#- Diagramatic representation of an algorithm
#- Common shapes and well known meanings
#- Restricted set of 'operations' encourages deep thinking

time limit
Task 4.1 Structured English and Pseudocode
Download and print Structured English, Pseudocode and Pascal. Look carefully at the differences and relationships between the Structured English, Pseudocode and finally the Pascal solution (which is a really old language but it looks like Pseudocode).

Answer the questions in your notebooks.

OUTCOME : Questions answered in your notebooks, correctly.

Checkpoint
[o c:""]
Flowcharts are a visual way of representing algorithms. You've met them before, so there is little point in teaching you how to suck eggs, however ...

time limit
Task 4.2 Flowchart exercises
Visit the following website, read the introduction and attempt the exercises. Try to work quietly and independently until you get all the correct answers!
OUTCOME : Satisfaction!

Checkpoint
[o c:""]
There is a great piece of software that you can use if you wish to experiment with flowcharting in more depth ...

image
Click to visit the Raptor Homepage
Activity 5
Coding style
When developing coded solutions to problems, it's all about style!
image
Click to engage

time limit
Task 5.1 To Do List
Like you did at the beginning, carry out an audit of your individual skill level. You should use the table above to create a to-do list of the skills which you have and desire.

OUTCOME : To-do list

Checkpoint
[o c:""]
Activity 6
AFK!
Before you even begin to program a solution to a problem, it's a good idea to check that you algorithm actually works correctly. This is always done away from the computer and is known as Desk Checking, or sometimes Dry Running. In the process of checking the correctness of the algorithm, it is common to construct a Trace Table.

time limit
Task 6.1 Desk Checking
Download and complete the desk_checking.docx worksheet. Do this OFFLINE - do not use a computer to present your working. The whole point is that you are trying to model the computer!

Outcome: Completed examples of desk checking.

Checkpoint
[o c:""]

Extension Activities

How about these?

#- Download and complete the What's the question activity. Hand it into your teacher for checking.

#- Read this PDF file which outlines a real algorithm for making the perfect cup of tea. Read this and be amazed that people take tea comparison that seriously!

#- Download, extract and inspect this zip file which contains lots of Raptor exercises and example flowcharts. Work through these and see how far you get.

#- Algorithms are not the same as computer programs. Discuss.

#- ISBN Number: What is the structure of an ISBN number? How is the check digit calculated? You might wish to look at the Wikipedia article (which also has Python code for a solution!)

#- Right Angle Triangle: The following problem has been set. A right-angled triangle has sides a, b and c. Pythagoras’ theorem states that a2 = b2 + c2. The problem is to create a process that will find and output the length of side a for any given inputs b and c. Express the solution to this problem in a) structured English and b) Pseudocode. Create a program flowchart in Raptor or yEd for this algorithm and print out the flowchart for your assessment books.

#- Standard, well known algorithms: Have a quick look at this list of algorithms and take note (in your brain) of the sheer number of ‘standard’ algorithms.

What's next?

Before you hand your book in for checking, make sure you have completed all the work required and that your book is tidy and organised. Your book will be checked to make sure it is complete and you will be given a spicy grade for effort.
END OF TOPIC ASSESSMENT
Last modified: February 14th, 2024
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning