• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part IIB: Intermediate Workshops > Creating a Currency-Exchange Calculator

Workshop Chapter 8. Creating a Currency-Exchange Calculator

The first seven workshop chapters were relatively basic. Sure, there were plenty of new concepts and unique solutions to problems, but there wasn’t all that much complex math or string manipulation, any interfacing with external data, and just one optional custom class. If the first seven workshop chapters were “basic,” this workshop and the next four will be “intermediate” workshops. As such, some of the steps are not explained as fully as they have been in the first workshops. Instead, I’ll try to reference where the topics were first covered. Don’t worry, the remaining workshop chapters won’t be impossible, they’ll just involve different topics.

In this workshop chapter, we’ll build a currency-exchange calculator. The user will be able to input any value and, based on the exchange rate, calculate the equivalent cost in another currency. As is true with many of the workshop chapters, the finished product is not necessarily something you’ll use as-is, but the process of working through the exercise will teach you some very valuable techniques. If you’ve read all the chapters in the “Foundation” section of this book, you’ll no doubt recall the several times I referred you to this workshop. A lot is covered here. Specifically, you’ll do some simple math and some slightly more complex math. You’ll encounter some of the challenges when you have to convert between numbers and strings. You’ll also look at ways to improve the user experience by adding a feature that enables the user to select from predefined exchange rates for different countries. Just to make it easy for us (and because exchange rates vary daily), we’ll make it possible to load in the current exchange rates from external sources. Although you may never have to build a currency-exchange calculator again, I’ll be willing to bet that you’ll be able to use all of the topics covered here!


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint