with Ada.Text_IO,Ada.Integer_Text_IO;
use Ada.Text_IO,Ada.Integer_Text_IO;
procedure CaseDemo is
begin
for How_Many in 4..13 loop
Put("We now have ");Put(How_Many,3);Put(" widgets, ");case How_Many is
when 4..6=>Put("which is too few");
when 7|9=>Put(" but we don't need 7 or 9");
when 13=>Put(" but that is too many.");
when 8|10|12=>Put(" which is a large even number!");
when 11=>Put("enough for a football team.");
end case;
New_Line;
end loop;
New_Line;for How_Many in 100..105 loop
Put("It is now");Put(How_Many,3);Put(" ");case How_Many is
when 100=>Put("the value is 100, and useless");
when 101=>for Index in 2..5 loop
Put("Puppy");
end loop;
when 103=>if True then
Put("Of course TRUE will always be true");
end if;
when 105=>null;
when others=>Put("this is one of those not defined");
end case;
New_Line;
end loop;
end CaseDemo;