Skip to content

Commit 29fe9f6

Browse files
Merge remote-tracking branch 'origin/master' into mr/369-update_slide_styles_and_colors
2 parents 5166986 + 651d3ed commit 29fe9f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+160
-832
lines changed

courses/ada_essentials/030_scalar_types/01-introduction.rst

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,37 @@ Discrete Types
88

99
* **Individual** ("discrete") values
1010

11-
- 1, 2, 3, 4 ...
12-
- Red, Yellow, Green
11+
* Can easily identify next/previous value
1312

1413
* Integer types
1514

16-
- Signed integer types
17-
- Modular integer types
15+
- Signed integer types
1816

19-
* Unsigned
20-
* **Wrap-around** semantics
21-
* Bitwise operations
17+
.. code:: Ada
18+
19+
type Integer_T is range -1 .. 1000;
20+
Number : Integer_T := 123;
21+
22+
- Modular integer types
23+
24+
* No sign bit
25+
* **Wrap-around** semantics
26+
* Bitwise operations
27+
28+
.. code:: Ada
29+
30+
type Unsigned_T is mod 256;
31+
Unsigned : Unsigned_T := 123;
32+
Bitwise : Unsigned_T := Unsigned and 16#55#;
2233
2334
* Enumeration types
2435

25-
- Ordered list of **logical** values
36+
- Ordered list of **logical** values
37+
38+
.. code:: Ada
2639
40+
type Enumeration_T is (Red, Yellow, Green);
41+
2742
------------
2843
Real Types
2944
------------
@@ -35,3 +50,8 @@ Real Types
3550
* :dfn:`Fixed-point` numbers have a **constant** exponent portion
3651

3752
* Allows for simpler (integer-based) computer math
53+
54+
.. code:: Ada
55+
56+
type Float_T is digits 6;
57+
type Fixed_T is delta 0.01;

courses/ada_essentials/040_statements/01-introduction.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,8 @@ Procedure Calls (Overview)
4141
4242
* Procedure calls are statements
4343

44-
* Traditional call notation
45-
4644
.. code:: Ada
4745
4846
Activate (Idle, True);
4947
50-
* "Distinguished Receiver" notation
51-
52-
.. code:: Ada
53-
54-
Idle.Activate (True);
55-
5648
* More details in "Subprograms" section
57-

courses/ada_essentials/060_record_types/lab/record_types/answer/main.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ begin
3232

3333
Total := Integer (Point_1.Inches) +
3434
Integer (Point_2.Inches);
35-
if Total > Max_Inches then
35+
if Total >= Max_Inches then
3636
Distance.Inches := Inches_T (Total - Max_Inches);
3737
Distance.Feet := 1;
3838
else

courses/ada_essentials/070_subprograms/lab/subprograms/answer/main.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ procedure Main is
2222
return List'Last;
2323
end if;
2424
end Search;
25-
--Search
2625

2726
List : List_T (1 .. 20);
2827
Length : Natural := 0;
28+
--Search
2929

3030
--Main
3131
procedure Add (Item : Integer) is

courses/ada_essentials/140_access_types/88-access_types.lab.rst

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,52 @@ Lab
55
------------------
66
Access Types Lab
77
------------------
8+
9+
* Build an application that adds / removes items from a linked list
810

9-
* Overview
11+
* At any time, user should be able to
1012

11-
- Create a (really simple) Password Manager
13+
* Add a new item into the "appropriate" location in the list
14+
* Remove an item without changing the position of any other item in the list
15+
* Print the list
1216

13-
* The Password Manager should store the password and a counter for each of some number of logins
14-
* As it's a Password Manager, you want to modify the data directly (not pass the information around)
17+
* Required goals
1518

16-
* Requirements
19+
1. Implement **Add** functionality
1720

18-
- Create a Password Manager package
21+
* For this step, "appropriate" means either end of the list (but consistent - always front or always back)
1922

20-
* Create a record to store the password string and the counter
21-
* Create an array of these records indexed by the login identification
22-
* The user should be able to retrieve a pointer to the record, either for modification or for viewing
23+
2. Implement **Print** functionality
24+
3. Implement **Delete** functionality
2325

24-
- Main program should:
26+
-------------------------
27+
Lab Solution - Database
28+
-------------------------
2529

26-
+ Set passwords and initial counter values for many logins
27-
+ Print password and counter value for each login
30+
.. container:: source_include 140_access_types/lab/access_types/answer/database.ads :code:Ada :number-lines:1
2831

29-
* Hint
32+
.. container:: source_include 140_access_types/lab/access_types/answer/database.adb :code:Ada :number-lines:1
3033

31-
- Password is a string of varying length
34+
-------------------------------------
35+
Lab Solution - Database_List (Spec)
36+
-------------------------------------
3237

33-
- Easiest way to do this is a pointer to a string that gets initialized to the correct length
38+
.. container:: source_include 140_access_types/lab/access_types/answer/database_list.ads :code:Ada :number-lines:1
3439

35-
----------------------------------------------
36-
Access Types Lab Solution - Password Manager
37-
----------------------------------------------
40+
-----------------------------------------------
41+
Lab Solution - Database_List (Helper Objects)
42+
-----------------------------------------------
3843

39-
.. container:: source_include 140_access_types/lab/access_types/answer/password_manager.ads :code:Ada
44+
.. container:: source_include 140_access_types/lab/access_types/answer/database_list.adb :start-after:helpers_begin :end-before:helpers_end :code:Ada :number-lines:1
4045

41-
.. container:: source_include 140_access_types/lab/access_types/answer/password_manager.adb :code:Ada
46+
-----------------------------------------------
47+
Lab Solution - Database_List (Insert/Delete)
48+
-----------------------------------------------
4249

43-
----------------------------------
44-
Access Types Lab Solution - Main
45-
----------------------------------
50+
.. container:: source_include 140_access_types/lab/access_types/answer/database_list.adb :start-after:insert_and_delete_begin :end-before:insert_and_delete_begin :code:Ada :number-lines:35
4651

47-
.. container:: source_include 140_access_types/lab/access_types/answer/main.adb :code:Ada
52+
---------------------
53+
Lab Solution - Main
54+
---------------------
55+
56+
.. container:: source_include 140_access_types/lab/access_types/answer/main.adb :code:Ada :number-lines:1

courses/ada_essentials/140_access_types/lab/access_types-in_depth/answer/default.gpr

Lines changed: 0 additions & 7 deletions
This file was deleted.

courses/ada_essentials/140_access_types/lab/access_types-in_depth/answer/main.adb

Lines changed: 0 additions & 42 deletions
This file was deleted.

courses/ada_essentials/140_access_types/lab/access_types-in_depth/answer/memory_mgmt.adb

Lines changed: 0 additions & 6 deletions
This file was deleted.

courses/ada_essentials/140_access_types/lab/access_types-in_depth/answer/memory_mgmt.adb.storage

Lines changed: 0 additions & 92 deletions
This file was deleted.

courses/ada_essentials/140_access_types/lab/access_types-in_depth/answer/memory_mgmt.ads

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)