Boolean
TypeCharacter
TypeCASE
StatementSo far in our programming, we have used six predefined data types:
Integer
, Natural
, Positive
,
Float
, Boolean
, and Character
. In this
chapter, we take a closer look at these data types and discuss the various
operations that can be performed on them. All the data types in this chapter
are scalar data types; that is, only one value can be stored in a single
variable. In later chapters, we will study composite data types; that
is, data types that can be used to store multiple values in a single variable.
In Sections 7.2 and
7.3
we revisit some of the facilities in Ada.Numerics
, showing how to
plot a sine curve and generate random numbers; we also return to the spider,
causing it to take a drunken, random walk around its room.
Section
7.6 introduces one more control structure, namely the CASE
statement. This statement is a convenient alternative to the
multiple-alternative IF
structure in many programs.
Finally, Section 7.7 opens up the body of the spider package; by now you have learned enough material to understand this package in its entirety.
Copyright © 1996 by Addison-Wesley Publishing Company, Inc.