Page 239 -
P. 239

another discount



                                             That‛s fantastic!
                                            You made the change
                                            so quickly, just in time
                                            for the doors to open. It
                                            does handle both kinds of
                                                discount, right?


                                                  Both kinds of discount?

                                                  It seems that there was something that the boss forgot to tell
                                                  you. As well as deciding to cut the health club’s own prices, he
                                                  also got in touch with his old friend, the CEO of Starbuzz,
                                                  and arranged for a special discount for everyone who shows
                                                  the cashier a Starbuzz Discount Card. This is the email he
                                                  received back:






                                           Great to hear from you!
                                           Yes, of course, you can join the Starbuzz discount scheme! A lot of
                                           people across the world are now working on systems for Starbuzz,
                                           so I think I can help your coders out. Please find attached a
                                           copy of the official Starbuzz Discount Module (tm). It's a Python
                                           module that will calculate an additional 5% discount for every
                                           customer who presents a Starbuzz Discount Card.
                                            If we ever change the way the discount scheme works in the
                                            future, we can send you an updated module and your systems
                                            will get updated without you having to do any work at all!

                                            Be well and keep drinking the coffee!
                                            Your friend,
                                             Starbuzz CEO






                                                  That’s great news. Although you’ve heard about this extra discount
                                                  late in the day, at least most of the work’s already been done for you.
                                                  You just need to use the Python module the Starbuzz CEO attached
                                                  to his email, and your program will be set up to apply both discounts.

                                                  Let’s take a look at the Starbuzz code.



           204    Chapter 6
   234   235   236   237   238   239   240   241   242   243   244