Which operator is used to map a value to a specific parameter or choice.
=> arrow
Who led the main consortium team to revise Ada to become Ada 95?
Tucker Taft
Identify the pair of keywords used to perform short-shircuit logical evaluations.
and then and or else
Which common graph representation is memory-efficient, allows for fast iteration, and makes adding edges easy by treating the graph like a collection of linked lists?
Adjacency List
The Ada feature that allows defining operations that work on different concrete types using inheritance and dispatching.
Polymorphism
Ada 83 already featured full support for inheritance and polymorphism before the Ada 9X project began.
False. Ada 83 lacked full support for these OOP features, which is the primary reason of Ada 95 being developed
An unconstrained array (defined with the box notation <>) requires the index bounds to be specified at the time the variable is declared.
True
It is allowed in Ada 95 to name a variable starting with underscores as long as a letter would follow
False. Underscores cannot be the first or last character of the identifier, and cannot have two underscores in a row
A loop statement must have a loop statement identifier in order to perform iteration.
False
Ada 95 includes object-oriented features such as tagged types and dispatching operations
True
Determine the output of variable G in this Ada 95 program.
with Ada.Text_IO; use Ada.Text_IO;
procedure AliasD is
G : Integer := 10;
procedure Modify (P : in out Integer) is
begin
G := 50;
P := P + 1;
end Modify;
begin
Modify(G); – We pass the Global variable as the parameter
Put_Line(Integer’Image(G));
end AliasD ;
11 because of the strict Ada 95 rule of by copy
What is the output of this PrintChar Ada 95 program?
with Ada.Text_IO; use Ada.Text_IO;
procedure PrintChar is
– A procedure that accepts a String of any length
procedure Print_Head (S : String) is
begin
Put(S(1)); end Print_Head;
Message : String(10 .. 12) := “Ada”;
begin
Print_Head(Message);
end PrintChar;
Constraint_Error because the first character starts at 10 and 1 is out of bounds.
Given the array declaration type Int_Array is array (1 .. 10) of Integer;, how do you access the sixth element?
Int_Array(6)
Determine the output of this simple call and return Ada 95 program when Main is executed.
procedure Print_Message is
begin
Put_Line(“Is this the end?”);
end Print_Message;
procedure Main is
begin
Print_Message;
Put_Line(“This is the start.”);
end Main;
Is this the end?
This is the start.
Determine the before and after values of the variable SwapVal and array named Names.
with Ada.Text_IO; use Ada.Text_IO;
procedure Simple_Swap is
– Define fixed-length string type
subtype Name_String is String(1..10);
– Define array type
type Name_Array is array (1..4) of Name_String;
– Initialize variables
SwapVal : Name_String := “Rodrigo “;
Names : Name_Array := (“Judyville “,
“Wennette “,
“Marie “,
“Eysie “);
Temp : Name_String;
begin
Temp := SwapVal;
SwapVal := Names(1);
Names(1) := Temp;
Put_Line(“After swap:”);
Put_Line(“SwapVal = “ & SwapVal);
for I in Names’Range loop
Put_Line(“Names(“ & Integer’Image(I) & “) = “ & Names(I));
end loop;
end Simple_Swap;
After swap:
SwapVal = Judyville
Names( 1) = Rodrigo
Names( 2) = Wennette
Names( 3) = Marie
Names( 4) = Eysie