skip to main content
10.1145/273133.273159acmconferencesArticle/Chapter ViewAbstractPublication PagessigcseConference Proceedingsconference-collections
Article
Free access

Using inheritance for computing with physical quantities: an interdisciplinary project

Published: 01 March 1998 Publication History

Abstract

This paper involves an interdisciplinary project in computer science and physics. Students in introductory physics courses need to be able to deal with dimensioned quantities (often called "dimensional analysis"), and to solve problems using the correct units for various physical quantities. Computer science students need to understand concepts of object-oriented programming, including the notion of inheritance. In this paper we present a project in which physical quantities such as distance, time, mass, speed, force, power, etc. are represented as objects. The student designing the classes can ensure that the client always combines quantities in an appropriate fashion (e.g. a force must be computed as a mass multiplied by an acceleration). The student designing the classes can also allow the client to compute physical quantities using different units (e.g., the addition of three distances: 1 inch + 2 meters + 3 feet). This is done by defining subclasses Meters, Miles, and Feet, all of which inherit from the class Distance, thus providing the student with a nice example of the proper use of inheritance.The relevant classes, with test driver software, have been implemented and are available at the URL: http://www.rowan.edu/~bergmann The software has been implemented in both C++ and Java, though this paper will use the C++ version in its exposition.

References

[1]
Arnold, K., and j. Gosling, The JavaTM Prom'ammin~ Language, Addison-Wesley, 1996.
[2]
Henderson, P., Functional Pro~ammm~: ADolication and Implementation, Prentice-Hall, 1980.
[3]
Reek, K., "Teaching Inheritance Versus Inclusion to First Year Computer Science Students", 'SiGCSE '96 Proceedings of the Twenty-Seventh SIGCSE Technical Svmoosium on ComDuter Science Education, Philadelphia PA, 1996.
[4]
Resnick, R. and D. Halliday, ~ Wiley, 1966.
[5]
Stroustrup, B., The .C++ Programming Language, Addison-Wesley, 1993.
[6]
Weisart, C., "Point-Extent Pattemfor Dimensioned Numeric Classes", ACM SIGPLAN Notices, Nov. 1997.
[7]
Wolfram, S., The Mathematiea~ Book, Cambridge University Press, 1996.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SIGCSE '98: Proceedings of the twenty-ninth SIGCSE technical symposium on Computer science education
March 1998
396 pages
ISBN:0897919947
DOI:10.1145/273133
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: 01 March 1998

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

SIGCSE98
Sponsor:
SIGCSE98: Technical Symposium on Computer Science Education
February 26 - March 1, 1998
Georgia, Atlanta, USA

Acceptance Rates

SIGCSE '98 Paper Acceptance Rate 72 of 201 submissions, 36%;
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

  • Downloads (Last 12 months)85
  • Downloads (Last 6 weeks)13
Reflects downloads up to 04 Jan 2025

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media