skip to main content
10.1145/1734263.1734391acmconferencesArticle/Chapter ViewAbstractPublication PagessigcseConference Proceedingsconference-collections
research-article

Monetary values: double trouble or dollars and sense?

Published: 10 March 2010 Publication History

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.

References

[1]
Armstrong, John N. 2004. Java & Monetary Data. Dr. Dobb's Journal (May, 2004). See: http://www.ddj.com/java/184405653?pgno=1
[2]
Basso, D., Schwartz, R. 1981 Programming with FORTRAN/WATFOR/WATFIV, Winthrop Publishers.
[3]
Bates, F. and Douglas, M. 1975 Programming Language/One, Prentice-Hall.
[4]
Bowles, K. 1977 Problem Solving Using PASCAL, Springer-Verlag.
[5]
Conway, R., Gries, D., Zimmerman, E. 1981 A Primer On Pascal, Winthrop.
[6]
Cooper, D., Clancy, M. 1982 Oh! Pascal!, Norton.
[7]
Cress, P., Dirksen, P., Graham, W. 1968 FORTRAN IV with WATFOR and WATFIV, Prentice-Hall. See page 109.
[8]
Dale, N., Weems, C., Headington, M. 2000 Programming and Problem Solving with C++, Jones-Bartlett.
[9]
Deitel, P., Deitel, H. 2008 C++ How To Program, Prentice-Hall.
[10]
Didday, R., Page, R. 1974 FORTRAN for Humans, West.
[11]
Hirsch, S. 1973 Essentials of FORTRAN IV, Reston Publishing.
[12]
Horstman, C. 2006 Big Java, Wiley.
[13]
Jensen, K., Wirth, N. 1974 Pascal User Manual and Report, Springer-Verlag.
[14]
Kay, D. 1985 Programming for People/Pascal, Mayfield.
[15]
Keller, A. 1982 A First Course in Computer Programming using Pascal, McGraw-Hill.
[16]
Kelley, A., Pohl, I. 1984 A Book on C, Benjamin Cummings.
[17]
Kelley, A., Pohl, I. 2001 C by Dissection, Addison Wesley.
[18]
Lewis, J., Loftus, W. 2007 Java Software Solutions, Addison-Wesley.
[19]
Malik, D. 2004 C++ Programming: Program Design Including Data Structures, Thomson.
[20]
Marateck, S. 1977 Fortran, Academic Press.
[21]
McCracken, D. 1973 Guide to FORTRAN IV Programming, Wiley.
[22]
Microsoft Development Network (Office Developer Center) 2009 Currency and Decimal Data Types, http://msdn.microsoft.com/en-us/library/aa164763(office.10).aspx
[23]
Microsoft Development Network (SQL Developer Center) 2009 Data Types, http://msdn.microsoft.com/en-us/library/aa258271(SQL.80).aspx
[24]
MySQL 5.0 Reference Manual, 11.13 Precision Math, http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html
[25]
Richardson, G., Birkin, S. 1975 Problem Solving Using PL/C: An Introduction for Business and the Social Sciences, Wiley.
[26]
Savitch, W. 2005 Java: An Introduction to Problem Solving & Programming, Prentice-Hall.
[27]
Shortt, J., Wilson, T. 1982 Problem Solving and the Computer: A Structured Concept with PL/I (PL/C), Addison-Wesley.
[28]
Staugaard, A. 2004 Information Systems Programming with Java, Prentice-Hall.
[29]
Stein, G. 2009 private conversation with lead software project manager in a major Wall Street Brokerage.
[30]
Sturgal, J., Merchant, M. 1973 Applied FORTRAN IV Programming, Wadsworth.
[31]
Weinberg, G. 1966 PL/I Programming Primer, McGraw-Hill.
[32]
Wu, C. 2004 An Introduction to Object-Oriented Programming with Java, McGraw-Hill.
[33]
Hume, J., Holt, R. 1982 Structured Programming Using PL/1, Reston.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SIGCSE '10: Proceedings of the 41st ACM technical symposium on Computer science education
March 2010
618 pages
ISBN:9781450300063
DOI:10.1145/1734263
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 10 March 2010

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. currency representation
  2. monetary values
  3. numerical types

Qualifiers

  • Research-article

Conference

SIGCSE10
Sponsor:

Acceptance Rates

Overall Acceptance Rate 1,595 of 4,542 submissions, 35%

Upcoming Conference

SIGCSE TS 2025
The 56th ACM Technical Symposium on Computer Science Education
February 26 - March 1, 2025
Pittsburgh , PA , USA

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 158
    Total Downloads
  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 05 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media