336 Introduction to C++ Programming and Graphics
prod = 0.0D0
Do i=1,n
prod = prod + a(i)*b(i)
End Do
Return
End
Why C++?
AlthoughMatlabmakes life easy, the substantial memory requirements
and CPU cost are important considerations. Fortran 77is free, efficient,
and easy to learn. Why then consider C++? Knowledge of C++ endows us
with a wide selection of important programming tools related to object-oriented
programming.
Perhaps more important, methods and ideas of object-oriented program-
ming can be translated into physical concepts in the various fields of physical
sciences and engineering. This correspondence has not been yet explored to
its full extent due to the extreme specialization of the scientific disciplines.
Initiatives are under way to foster an interdisciplinary approach.