Ada by Example
Hello World, Text Output
Integer and Float Output, Attributes 'img and 'image, Keyword Parameters
Subtypes Natural and Positive, Strong Typing
Built-in Types Boolean, Character and their Output, Strings, Constants, Literals, Named and
Based numbers
Operators and Expressions, Attributes, More Attributes, Range Constraints,
More on Subtypes
New Numeric Types
- Modular Types (unsigned with modular arithmetic): hours.adb and prettified
- Fixed Point Types - Need to add examples
Enumeration Types
Input
- Integer Input: inp1.adb and prettified (N.B.
get(x)
skips white space and modifies its parameter, x
)
- I/O of new numeric types
- I/O of Enumeration types
- Character input: inp2.adb and prettified
(N.B. skips end of line, but NOT other white space)
- String input: string_in.adb and prettified
(N.B. Reads exactly enough characters to fill string; skips end of line, but NOT other white space)
- Mixing text and integer input (Must call Skip_Line): [To be done]
- Redirecting Standard Input: stdin.adb and prettified
- Warning: problems can occur if data file and executable are created
with different operating systems because of different line end characters
Summary Example: Basic Types, Operators, Expressions, Type Checking, I/O, Control Structures
Declare Blocks
Control Structures
Procedures and Functions
Global Variables
Exceptions
Arrays
Renaming, Command Line, Working With Files and Default_Input