The code that you write will make its way into many programs.
And, although sharing is good, you need to be careful. One programmer might take your code and use it in an unexpected way, while another might change it without even letting you know. You might want to use one function in all your programs and, over time, that function’s code might change to suit your needs. Smart programmers take advantage of modular programming techniques to keep their workload manageable. Let’s find out how in the pages that follow...
Head First Health Club has a new CEO, and he loves new technology. He was shocked when he saw how old the sales systems were.
A point-of-sale (POS) system is just a computer program that works like a cash register. The boss doesn’t want to replace all of the cash registers immediately. He wants to begin with a trial system in the coffee bar.
It would be nice if the systems you produce were modular in design. You’ll get to that AFTER you’ve spent some time understanding what’s required.
Let’s see what the coffee bar POS needs to do.
The POS program will record credit card sales in a file called
transactions.txt. At the end of ...