Monetary values: double trouble or dollars and sense?

  • Authors:
  • Aaron Tenenbaum;Gerald Weiss;David Arnow

  • Affiliations:
  • Brooklyn College, Brooklyn, NY, USA;Brooklyn College, Brooklyn, NY, USA;Brooklyn College, Brooklyn, NY, USA

  • Venue:
  • Proceedings of the 41st ACM technical symposium on Computer science education
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

It is curious but there is widespread misuse of floating-point types to represent monetary amounts in introductory programming classes. This is evident from a survey of popular CS1 textbooks. It is instructive to examine how dollars and cents and other currency values are represented in actual practice and how we can utilize those techniques in computer science education, for both the sake of correctness and to illustrate important general principles. Furthermore, it is particularly interesting to review the history of CS education and determine how this situation came to pass. The interplay between technology, academic cultures and institutional development turns out to be quite significant.