{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

8new_subtyp_enum

8new_subtyp_enum - Introduction to Computers and...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computers and Programming Lecture 8 Types values similarity of values and primitive operations Elementary types Composite Types Prof. I. K. Lundqvist Reading: FK pp. 115-151 Sept 17 2003 • Type – A set of – A set of primitive operations • Grouped into classes based on the
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Elementary Types : Values are logically indivisible Composite Types : Values composed from components Type Classification Elementary Types Scalar Types Access Types Discrete Types Real Types Scalar Types relational operators are defined position number Scalar Types Discrete Types Real Types Integer Types Enumeration Types Fixed Point Floating Point • Ordered • Each value of a discrete type has a
Image of page 2
Attributes of Scalar Types range of S. The value of this attribute is of the type of S. range of S Operations on Scalar Types the value in the type string on the scalar type – S’Succ (Integer) : returns (Integer + 1) S’First denotes the lower bound of the S’Last denotes the upper bound of the S’Range is equivalent to the range S’First .. S’Last S’Min returns lower of two elements S’Max returns higher of two elements S’Value accepts a string and returns S’Image converts the value into a S’Pred and S’Succ – behavior depends S’Pred (Integer) : returns (Integer -1)
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Subtypes • A subtype type.
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}