January 24, 2012
[Video] Coding Session #14: Object Oriented Programming
If you order 46 pairs of shoes, 23 bags, 15 balls, and one commemorative bowling pin—how many boxes does it take to ship your order and how much does it all weigh?
Sounds like some messed up test question your insane teacher threw on an Algebra I test just to see how many kids would cry. I remember thinking in school, "Who the f' cares when the stupid train arrives in the next town?!"
I still have my doubts about trains but in this coding session I find out first hand that Post Offices do care about boxes and how much they weigh.
How would you solve this shipping problem in code?
Object oriented programming to the rescue. And a good debugger. And a buddy looking over your shoulder and catching your mistakes.