RU beehive logo ITEC dept promo banner
ITEC 320
2018fall
nokie
ibarland

ada syntax intro

Go over features in: hw01.html

More example programs: www.radford.edu/nokie/classes/320/declareints.html


Some Loops

We'll have more to say about loops, but here are three ways to count from 10 through 20:


Definition: an (abstract data) Type is a set of values with a set of operations.


Operators: glance at operators and expressions and note:

More on ranges

We have seen ranges used in loops, and in subtypes. (remind).
They can also be used with the “in” operator!:

        if n in 10..20 then …
        
        workwork : Boolean := day in Mon..Fri and not federalHoliday;
      

Still not cool enough? Multiple ranges can be combined with the “|” operator as shown:

        if n in 10..20|99|-12..-6 then …
    


Note: Example of put mentions that we can't mix positional *after* a keyword;

Note: call by fully-resolved name: `Ada.Integer_Text_IO.put( "hello" );` . This statement is also a type-error, and it demonstrates that the error message, when involves IO libraries, is kinda long; the essence of the message is a bit buried.


logo for creative commons by-attribution license
This page licensed CC-BY 4.0 Ian Barland
Page last generated 2018.Sep.10 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.