Book contents
- Frontmatter
- Contents
- Preface
- One Program Design
- Two Data Types
- Three Object-Oriented Programming Concepts
- Four Features of Programming Languages
- Five Object-Oriented Methods
- Six Inheritance and Polymorphism
- Seven OO Data Structures
- Eight Arrays and Matrices
- Nine Advanced Topics
- Appendix A Fortran 90 Overview
- Appendix B Selected Exercise Solutions
- Appendix C Companion C++ Examples
- Bibliography
- Glossary of Object-Oriented Terms
- Index
Two - Data Types
Published online by Cambridge University Press: 15 October 2009
- Frontmatter
- Contents
- Preface
- One Program Design
- Two Data Types
- Three Object-Oriented Programming Concepts
- Four Features of Programming Languages
- Five Object-Oriented Methods
- Six Inheritance and Polymorphism
- Seven OO Data Structures
- Eight Arrays and Matrices
- Nine Advanced Topics
- Appendix A Fortran 90 Overview
- Appendix B Selected Exercise Solutions
- Appendix C Companion C++ Examples
- Bibliography
- Glossary of Object-Oriented Terms
- Index
Summary
Any computer program is going to have to operate on the available data. The valid data types that are available will vary from one language to another. Here we will examine the intrinsic or built-in data types and user-defined data types or structures and, finally, introduce the concept of the abstract data type, which is the basic foundation of object-oriented methods. We will also consider the precision associated with numerical data types. The Fortran data types are listed in Table 2.1. Such data can be used as constants, variables, pointers, and targets.
Intrinsic Types
The simplest data type is the LOGICAL type, which has the Boolean values of either .true. or .false. and is used for relational operations. The other nonnumeric data type is the CHARACTER. The sets of valid character values will be defined by the hardware system on which the compiler is installed. Character sets may be available in multiple languages such as English and Japanese. There are international standards for computer character sets. The two most common ones are the English character sets defined in the ASCII and EBCDIC standards that have been adapted by the International Standards Organization (ISO). Both of these standards for defining single characters include the digits (0 to 9), the 26 uppercase letters (A to Z), the 26 lowercase letters (a to z), common mathematical symbols, and many nonprintable codes known as control characters.
- Type
- Chapter
- Information
- Object-Oriented Programming via Fortran 90/95 , pp. 26 - 35Publisher: Cambridge University PressPrint publication year: 2003