Retrieving an Element of an Array: Difference between revisions

m
→‎{{header|Ada}}: syntax highlighting
(Logo)
m (→‎{{header|Ada}}: syntax highlighting)
Line 12:
=={{header|Ada}}==
Array indexed by an enumerated type. Ada enumerated types are discrete non-numeric types.
<ada>
type Days is (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
type Daily_CountsDays is array(Days)Mon, ofTue, NaturalWed, Thu, Fri, Sat, Sun);
This_week :type Daily_Counts :=is array(200,Days) 212,of 175 220, 201, 120, 0)Natural;
This_week : Daily_Counts := (200, 212, 175 220, 201, 120, 0);
Monday_Sales : Natural;
 
Monday_Sales := This_Week(Mon);
</ada>
Monday_Sales is assigned 200
 
Anonymous user