A few weeks ago, I posted a Blog post about linking some coding tasks to the curriculum, one task was to write a program to convert a number of TB / MB / KB so that it would calculate the number of bits.
My attempt was a program that some functions that I had written to achieve the aim and that code can be seen and accessed here.
What really was great was that this week, two of my students worked hard on this assignment and I was very pleased to see some really nice refinements (and differences from my approach!). Coding it so much more creative than most people give credit! At the end of the day, what is needed is code that works (and works well) and there are many multiple paths to achieve the objective.
I had used procedures to manage the process (perhaps a throwback to the days when I learnt to program in the first place when a modular approach to coding really made things easier!)
The other differences my Year 11 students came up with were:
- The students had used a float as the input instead of an integer
- The program follows a simple and linear progression using if / elif / else
- What was particularly great was the delay technique used to slow the output which gave the program a nice aesthetic that had been missing from my program!
Both versions of the program can be accessed here (with the spreadsheet version).