Download presentation
Presentation is loading. Please wait.
Published bySkylar Prew Modified over 9 years ago
1
Coding
2
Steps to Success 1.Create a PLAN including a detailed statement of requirements (SORs) 2.Write algorithms based on the SORs 3.Write pseudocode from the algorithms 4.Write the code from the pseudocode 5.Test
3
Planning You will have been given a specification of what the program should do Turn this into a statement of requirements Make sure you include lots of –It will ….. –The program must…. –The user can…..
4
Algorithms An algorithm is a set of steps to solve a problem. Algorithms don’t have to be implemented by a computer It must solve the problem completely and in a logical manner For more complex problems you can adopt a “black box” approach – You know what the outcome will be but currently not the process to achieve it –Postpone the solution until you have more knowledge about how to solve the problem Algorithms are best not written in a programming style language – leave that to you pseudocode
5
Code Buddy Get a code buddy to work with Your code buddy should: –The first person to ask when you have a problem –Read your code and give you feedback –Be someone to talk ideas through with Your code buddy is NOT: –Someone you copy code from
6
Algorithms to Code Coding is a complicated business and when you are starting out it is difficult to look at an empty screen and write code. It’s a bit like someone giving you a sheet of paper and asking you to write a essay. 1.Write an algorithm –These are high level statements written in a structured way so that a reasonable person could follow them and produce the result you expect. The can be gaps in the finer detail of what happens 2.Convert the algorithm to pseudocode –Take each of the high level statements of your algorithm and turn it into pseudocode. –Some of the statement will result in more than one line of pseudocode. This is where you really begin to understand how your program will work. 3.Convert the pseudocode to target language code –This bit should bee easier because the pseudocode should roughly translate line for line with the statements in your target language. –You will be able to use some of the language construct and functions to help improve the efficiency of the pseudocode
7
Do Not Code Without a Plan Have a clear plan – without one you could end up in the wrong place! A A B B C C
8
Do Not Code Without a Plan You must complete your pseudocode BEFORE you start coding This will: –Help you be clear about what you have to do –Revise you ideas about the logic of the program before you code –Code the result faster
9
There will be problems! With a plan you can navigate a way round obstacles that crop up along the way A A B B
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.