Apply what you understand
A score validator with a test table
A working program is the beginning. Explain your decisions and show evidence that they hold up.
The challenge
Adapt the starter into an explainable score validator with a documented review threshold. Use fixed raw values for repeatable practice before adding interactive input.
Evidence to include
- Document accepted values and the response to invalid values.
- Test -1, 0, 1, 99, 100, and 101.
- Test the review threshold on both sides and exactly at it.
- Explain the membership test, conversion, and any message formatting.
- Include actual output and a short self-review note.
Starter code
with Ada.Text_IO;
procedure Main is
subtype Score is Integer range 0 .. 100;
Raw : Integer := 101;
begin
if Raw in Score then
Ada.Text_IO.Put_Line ("Accepted" & Score'Image (Score (Raw)));
else
Ada.Text_IO.Put_Line ("Score must be between 0 and 100");
end if;
end Main;Save your practice
Sign in to save a project submission.