If

If practice


Write a program that takes the speed limit and the car's speed as the inputs and reports how big a fine and how many demerit points the driver gets.

We will work through this program together as an example of how to tackle a programming task.

First plan how your program will work...

What would be good tools for this  ?
What information do you need to complete the task ?
Are there any steps that you don't know how to program in Python ?
How are you going to test your program as it develops ?
What values are you going to use to test that your program is working properly ?


Some possible platforms for doing our planning in:
Microsoft Word / Google Docs for writing and keeping all our planning together
LucidChart extension in Chrome for doing flowcharts
Pen and paper

What we did
We put a title on our page so we knew what we were doing

We wrote our interpretation of the task. Writing out the brief in our own words is a good idea to ensure that what we think we have been asked to do is actually what we have been asked to do.

We wrote a list of the steps that we'd need to do to get the job done. Breaking down the task into smaller, more manageable pieces makes it much easier to cope with.

We needed to know what the fines and demerits were for different speeds so we searched the Internet, finding the speeding fine and demerit points tables on the NZ Police website.

We started a flowchart in LucidChart using the correct symbols. The Terminator for start/finish, the parallelogram for all data input/outputs, the rhombus for decisions (these will be out if statements in the program) and rectangles for any other processes that we need, like doing calculations.


Comments