Ada Programming Language
Ada Programming Language
Ada was originally designed by a team led by Jean Ichbiah of CII Honeywell Bull under
contract to the United States Department of Defense (DoD) from 1977 to 1983 to
supersede over 450 programming languages used by the DoD at that time.[9]
Ada was named after Ada Lovelace (18151852), who has been credited with being the
first computer programmer.
FEATURES
An enumeration type
Word_Boolean * 2 bytes with the values (False,
True)
AND
OR
RELATIONAL OPERATORS
/= Not Equal
= Equal
if condition then
statement;
else
other statement;
end if;
If-Else Statement
if condition then
statement;
elseif condition then
other statement;
elseif condition then
other statement;
else
another statement;
end if;
Case Statement
case X is
when 1 =>
Walk_The_Dog;
when 5 =>
Launch_Nuke_from_North_Korea;
when 8 =>
Finish_blended;
when others =>
Procrastinate;
end case;
UNCONDITIONALS
Return
return;
return Value;
Goto
goto Label;
<<Label>>
Statement;
LOOP STATEMENTS
Endless Loop
A_Label_for_Loop:
loop
Do_something;
end loop A_Label_for_Loop;
Loop with Condition at the beginning
(While Loop)
While_Loop:
while x <= 5 loop
x = x + 1;
end loop While_Loop;
Loop with condition at the end
(Until Loop/ Do While)
Until_Loop:
loop
x := x + 1;
exit Until_Loop when x > 5;
end loop Until_Loop;
Loop with Condition in the middle
(Exit Loop)
Exit_Loop:
loop
x := x + 1;
exit Exit_Loop when x > 5;
Do_Something;
end loop Exit_Loop;
For Loop
For_Loop:
for X in Integer range 1 .. 10 loop
Do_Something;
end loop For_Loop;
END