diff --git a/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types.rst b/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types.rst index d4fc0c52f..c55a3c8cf 100644 --- a/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types.rst +++ b/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types.rst @@ -73,7 +73,7 @@ Operators for Signed Integer Type Exponentiation (:ada:`**`) result will be a signed integer - - So power **must** be :ada:`Integer` ``>= 0`` + - Power **must** be :ada:`Integer` ``>= 0`` .. warning:: Division by zero |rightarrow| :ada:`Constraint_Error` @@ -181,7 +181,7 @@ Neighbor Attributes for All Scalars ... Signed := Signed_T'Succ (Signed); -- Signed = 0 ... - Unsigned := Unsigned_T'Pred (Unsigned); -- Signed = 255 + Unsigned := Unsigned_T'Pred (Unsigned); -- Unsigned = 255 ------------------------------------ Min/Max Attributes for All Scalars @@ -220,7 +220,7 @@ What happens when you try to compile/run this code? A. Compile error B. Run-time error -C. :answer:`V is assigned to -10` +C. :answer:`V is assigned the value -10` D. Unknown - depends on the compiler .. container:: animate diff --git a/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types_with_mod.rst b/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types_with_mod.rst index 7eafbf9a4..29d621920 100644 --- a/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types_with_mod.rst +++ b/courses/fundamentals_of_ada/030_basic_types/02-discrete_numeric_types_with_mod.rst @@ -73,7 +73,7 @@ Operators for Signed Integer Type Exponentiation (:ada:`**`) result will be a signed integer - - So power **must** be :ada:`Integer` ``>= 0`` + - Power **must** be :ada:`Integer` ``>= 0`` .. warning:: Division by zero |rightarrow| :ada:`Constraint_Error` @@ -243,7 +243,7 @@ Neighbor Attributes for All Scalars ... Signed := Signed_T'Succ (Signed); -- Signed = 0 ... - Unsigned := Unsigned_T'Pred (Unsigned); -- Signed = 255 + Unsigned := Unsigned_T'Pred (Unsigned); -- Unsigned = 255 ------------------------------------ Min/Max Attributes for All Scalars @@ -282,7 +282,7 @@ What happens when you try to compile/run this code? A. Compile error B. Run-time error -C. :answer:`V is assigned to -10` +C. :answer:`V is assigned the value -10` D. Unknown - depends on the compiler .. container:: animate diff --git a/courses/fundamentals_of_ada/030_basic_types/04-enumeration_types.rst b/courses/fundamentals_of_ada/030_basic_types/04-enumeration_types.rst index ad033c008..424575138 100644 --- a/courses/fundamentals_of_ada/030_basic_types/04-enumeration_types.rst +++ b/courses/fundamentals_of_ada/030_basic_types/04-enumeration_types.rst @@ -204,6 +204,6 @@ D. ``V4 : Enum_T := Enum_T'Value ("Able Baker Charlie");`` A. Legal B. Legal - conversion is case-insensitive - C. Legal - leading/trailing blanks are ignored + C. Legal - leading/trailing whitespace is ignored D. :ada:`Value` tries to convert entire string, which will fail at run-time diff --git a/courses/fundamentals_of_ada/030_basic_types/10-subtypes.rst b/courses/fundamentals_of_ada/030_basic_types/10-subtypes.rst index ed53a5237..c98076243 100644 --- a/courses/fundamentals_of_ada/030_basic_types/10-subtypes.rst +++ b/courses/fundamentals_of_ada/030_basic_types/10-subtypes.rst @@ -163,5 +163,5 @@ Which subtype definition is valid? A. This generates a run-time error because the first enumeral specified is not in the range of :ada:`Weekdays_T` B. Compile error - no type specified C. Correct - standalone subtype - D. :ada:`Digits 6` is used for a type definition, not a subtype + D. :ada:`digits 6` is used for a type definition, not a subtype diff --git a/courses/fundamentals_of_ada/050_array_types/01-introduction.rst b/courses/fundamentals_of_ada/050_array_types/01-introduction.rst index ed4608503..155a07e69 100644 --- a/courses/fundamentals_of_ada/050_array_types/01-introduction.rst +++ b/courses/fundamentals_of_ada/050_array_types/01-introduction.rst @@ -12,7 +12,7 @@ What Is an Array? .. container:: latex_environment small - :ada:`type is array (Index_Type) of Component_Type;` + :ada:`type is array (Index_Type) of Component_Type;` where @@ -27,7 +27,7 @@ where .. code:: Ada - type Array_T is array (0 .. 3) of Interfaces.Integer_32; + type Array_T is array (0 .. 3) of Interfaces.Integer_16; .. image:: array_diagram.svg diff --git a/courses/fundamentals_of_ada/050_array_types/03-unconstrained_array_types.rst b/courses/fundamentals_of_ada/050_array_types/03-unconstrained_array_types.rst index 20df2bb67..75e266d23 100644 --- a/courses/fundamentals_of_ada/050_array_types/03-unconstrained_array_types.rst +++ b/courses/fundamentals_of_ada/050_array_types/03-unconstrained_array_types.rst @@ -242,10 +242,10 @@ Quiz Which declaration(s) is (are) legal? - A. ``AAA : Array_T (0..99);`` - B. :answermono:`BBB : Array_T (1..32);` - C. :answermono:`CCC : Array_T (17..16);` - D. ``DDD : Array_T;`` + A. ``AAA : Bit_Array_T (0..99);`` + B. :answermono:`BBB : Bit_Array_T (1..32);` + C. :answermono:`CCC : Bit_Array_T (17..16);` + D. ``DDD : Bit_Array_T;`` .. container:: column @@ -253,7 +253,7 @@ Quiz Explanations - A. :ada:`Array_T` index is :ada:`Positive` which starts at 1 + A. :ada:`Bit_Array_T` index is :ada:`Positive` which starts at 1 B. OK, indices are in range C. OK, indicates a zero-length array D. Object must be constrained diff --git a/courses/fundamentals_of_ada/070_subprograms/02-syntax.rst b/courses/fundamentals_of_ada/070_subprograms/02-syntax.rst index 92f14ec98..27ef66dc3 100644 --- a/courses/fundamentals_of_ada/070_subprograms/02-syntax.rst +++ b/courses/fundamentals_of_ada/070_subprograms/02-syntax.rst @@ -172,7 +172,7 @@ Direct Recursion - No Declaration Needed else return Get_Vector & Next; end if; - end Input; + end Get_Vector; ---------------------------- Indirect Recursion Example diff --git a/courses/fundamentals_of_ada/120_limited_types/03-creating_values.rst b/courses/fundamentals_of_ada/120_limited_types/03-creating_values.rst index 8589da80c..ae5d40422 100644 --- a/courses/fundamentals_of_ada/120_limited_types/03-creating_values.rst +++ b/courses/fundamentals_of_ada/120_limited_types/03-creating_values.rst @@ -70,7 +70,7 @@ Writing Limited Constructor Functions function F return Spin_Lock is begin ... - -- This is not legal staring with Ada2005 + -- This is not legal starting with Ada2005 return Global_X; -- this is a copy end F; diff --git a/courses/fundamentals_of_ada/130_program_structure/05-visibility_limits.rst b/courses/fundamentals_of_ada/130_program_structure/05-visibility_limits.rst index ab11b98de..72905baca 100644 --- a/courses/fundamentals_of_ada/130_program_structure/05-visibility_limits.rst +++ b/courses/fundamentals_of_ada/130_program_structure/05-visibility_limits.rst @@ -178,7 +178,7 @@ Quiz .. container:: column - Which return statement would be legal in ``P.Child.X?`` + Which return statement(s) would be legal in ``P.Child.X?`` A. :answermono:`return Object_A;` B. :answermono:`return Object_B;` diff --git a/courses/fundamentals_of_ada/170_tagged_derivation/01-introduction.rst b/courses/fundamentals_of_ada/170_tagged_derivation/01-introduction.rst index 6b6ad791c..fe7841f74 100644 --- a/courses/fundamentals_of_ada/170_tagged_derivation/01-introduction.rst +++ b/courses/fundamentals_of_ada/170_tagged_derivation/01-introduction.rst @@ -13,9 +13,9 @@ Object-Oriented Programming with Tagged Types type T is tagged record ... -* Child types can add new components (*attributes*) +* Child types can add new components * Object of a child type can be **substituted** for base type -* Primitive (*method*) can :dfn:`dispatch` **at run-time** depending on the type at call-site +* Primitive can :dfn:`dispatch` **at run-time** depending on the type at call-site * Types can be **extended** by other packages - Conversion and qualification to base type is allowed diff --git a/courses/fundamentals_of_ada/180_polymorphism/04-exotic_dispatching_operations.rst b/courses/fundamentals_of_ada/180_polymorphism/04-exotic_dispatching_operations.rst index 78780159b..9b8a9ce35 100644 --- a/courses/fundamentals_of_ada/180_polymorphism/04-exotic_dispatching_operations.rst +++ b/courses/fundamentals_of_ada/180_polymorphism/04-exotic_dispatching_operations.rst @@ -47,7 +47,7 @@ Special Case for Equality type Dog is new Animal with null record; overriding function "=" (Left : Dog; Right : Dog) return Boolean; Animal_1, Animal_2 : Animal; - Dog_1, Dog_2 : Child; + Dog_1, Dog_2 : Dog; Any_Animal_1 : Animal'Class := Animal_1; Any_Animal_2 : Animal'Class := Animal_2; Dog_Animal : Animal'Class := Dog_1; @@ -79,7 +79,7 @@ Controlling Result (1/2) type Dog is new Animal with null record; -- OK, Feed_Treats is implicitly inherited - type Bulldog is new Animal with record + type Bulldog is new Dog with record Has_Underbite : Boolean; end record; -- ERROR no implicitly inherited function Feed_Treats diff --git a/courses/fundamentals_of_ada/230_interfacing_with_c/03-parameter_passing.rst b/courses/fundamentals_of_ada/230_interfacing_with_c/03-parameter_passing.rst index 319dc3bf0..ecd5a434b 100644 --- a/courses/fundamentals_of_ada/230_interfacing_with_c/03-parameter_passing.rst +++ b/courses/fundamentals_of_ada/230_interfacing_with_c/03-parameter_passing.rst @@ -64,6 +64,7 @@ Passing Structures As Parameters * Ada View .. code:: Ada + type Enum is (E1, E2, E3) with Convention => C; type Rec is record A, B : int; diff --git a/courses/fundamentals_of_ada/labs/answers/030_basic_types.txt b/courses/fundamentals_of_ada/labs/answers/030_basic_types.txt index 9c3cfb7db..e65497cc5 100644 --- a/courses/fundamentals_of_ada/labs/answers/030_basic_types.txt +++ b/courses/fundamentals_of_ada/labs/answers/030_basic_types.txt @@ -7,14 +7,14 @@ procedure Main is type Degrees_T is mod 360; - type Cymk_T is (Cyan, Magenta, Yellow, Black); + type Cmyk_T is (Cyan, Magenta, Yellow, Black); Number_Of_Tests : Number_Of_Tests_T; Test_Score_Total : Test_Score_Total_T; Angle : Degrees_T; - Color : Cymk_T; + Color : Cmyk_T; --Declarations --Implementation @@ -34,7 +34,7 @@ begin -- operations / attributes Test_Score_Total := Test_Score_Total / Test_Score_Total_T (Number_Of_Tests); Angle := Angle + 359; - Color := Cymk_T'Pred (Cymk_T'Last); + Color := Cmyk_T'Pred (Cmyk_T'Last); Put_Line (Test_Score_Total'Image); Put_Line (Angle'Image); diff --git a/courses/fundamentals_of_ada/labs/answers/230_interfacing_with_c.txt b/courses/fundamentals_of_ada/labs/answers/230_interfacing_with_c.txt index c3376fda2..aeb4ae3b5 100644 --- a/courses/fundamentals_of_ada/labs/answers/230_interfacing_with_c.txt +++ b/courses/fundamentals_of_ada/labs/answers/230_interfacing_with_c.txt @@ -20,11 +20,11 @@ procedure Main is Object_Feet : constant Data_T := (Distance => 6_000.0, Distance_Type => Feet, - Seconds => One_Minute_In_Seconds); + Seconds => Interfaces.C.C_float(One_Minute_In_Seconds)); Object_Meters : constant Data_T := (Distance => 3_000.0, Distance_Type => Meters, - Seconds => One_Hour_In_Seconds); + Seconds => Interfaces.C.C_float(One_Hour_In_Seconds)); Object_Miles : constant Data_T := (Distance => 1.0, Distance_Type => diff --git a/courses/fundamentals_of_ada/labs/prompts/030_basic_types/main.adb b/courses/fundamentals_of_ada/labs/prompts/030_basic_types/main.adb index bb3e17f08..4bb3d5d10 100644 --- a/courses/fundamentals_of_ada/labs/prompts/030_basic_types/main.adb +++ b/courses/fundamentals_of_ada/labs/prompts/030_basic_types/main.adb @@ -9,8 +9,8 @@ procedure Main is -- type Degrees_T is ? -- Angle : Degrees_T; - -- type Cymk_T is ? - -- Color : Cymk_T; + -- type Cmyk_T is ? + -- Color : Cmyk_T; begin