Page 226 -
P. 226

modular programming


          Your coffee bar program still uses

           the old format


          Your program in the coffee bar was never updated after the health club
           switched banks. It’s still doing what it always did: it’s still creating files
           in the old format.                                                So that‛s a donut.
                                                                             Better write Credit
           That old format wrote out the price and the credit card the other way   Card... then Price...
           round, which meant when your program wrote out a record like this:  then Description.


                                          Price = $1.50
           The credit card number
                                                                     Description

                 5079142874628151          0000150       DONUT



           The new bank read the record like this:

                                              Messed up credit card number:

            The price... $50,791.42!          the bank thought it was fake.        But at least the
                                                                                   description's OK.

                                 5079142      8746281510000150          DONUT


                                      This is suspicious...
                                       $50,000 for a donut....
                                       Does not compute... Fake
                                       credit card information!
                                       Security! Security!!


           So it’s not that somebody broke into your program and changed it.
           No, it’s the exact opposite. Your code never picked up the change that
           was made to the gym program in order to support the new format.








                                 What should you do to fix it? What shouldn’t you do?




                                                                                      you are here 4    191
   221   222   223   224   225   226   227   228   229   230   231