Add multilingual Agila learning examples and Git practice guide
This commit is contained in:
commit
85f487afb0
79 files changed
+813
No files matched your search
@@ -0,0 +1,9 @@
|
||||
# A reusable study-plan calculation
|
||||
|
||||
Build and test a small lesson-count component. Start with the nested function; optionally extract it into an Ada package in a local multi-file project.
|
||||
|
||||
- State the Total/Done policy without referring to source code.
|
||||
- Check (0,0), (4,0), (4,3), (4,4), and (4,5).
|
||||
- Explain why the subtraction is reached only when Done is below Total.
|
||||
- Keep calculation separate from output.
|
||||
- Include a review note explaining one design choice and one limitation.
|
||||
@@ -0,0 +1,13 @@
|
||||
with Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
function Remaining (Total, Done : Natural) return Natural is
|
||||
begin
|
||||
if Done >= Total then
|
||||
return 0;
|
||||
end if;
|
||||
return Total - Done;
|
||||
end Remaining;
|
||||
begin
|
||||
Ada.Text_IO.Put_Line (Natural'Image (Remaining (4, 1)));
|
||||
end Main;
|
||||
Reference in new issue
Block a user