Abstract
In this paper we have outlined an interdisciplinary software development project for students of computer science and physics. Students design and implement a collection of classes representing physical quantities, such as distance, time, and mass. Inheritance is used to implement various units for a particular dimension as subclasses. The student learns that, because a foot is a distance and a meter is a distance, inheritance is the appropriate mechanism here. The student also learns that certain computations should be disallowed since they are not meaningful. For example, the product of two distances should produce a syntax error (unless there is a class Area). Students design classes for more complex physical quantities such as speed, acceleration, force, momentum and energy. If implementing the classes in C++ the student also gets experience with operator overloading.
Original language | English (US) |
---|---|
Pages (from-to) | 45-47 |
Number of pages | 3 |
Journal | SIGCSE Bulletin (Association for Computing Machinery, Special Interest Group on Computer Science Education) |
Volume | 30 |
Issue number | 1 |
DOIs | |
State | Published - 1998 |
All Science Journal Classification (ASJC) codes
- Software
- Food Science
- Hardware and Architecture