Previous | Next | Table of Contents | Index | Program List | Copyright

CHAPTER 7

A Systematic Look at Scalar Data Types


7.1 Data Structures: Numeric Data Types
7.2 System Structures: More on Ada.Numerics; the
7.3 Continuing Saga: Random Numbers and the Drunken Spider
7.4 Data Structures: The Boolean Type
7.5 Data Structures: The Character Type
7.6 Control Structures: The CASE Statement
7.7 Continuing Saga: Inside the Spider Package
7.8 Tricks of the Trade: Common Programming Errors
Chapter Review

So 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.


Previous | Next | Table of Contents | Index | Program List | Copyright

Copyright © 1996 by Addison-Wesley Publishing Company, Inc.