What is wrong on code: String := (if statement) - image attached
7 February 2023 at 09:16
What is wrong?
This happens when I add elsif, and then.
โ
Code |
---|
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Main is
N : Integer;
begin
Put ("Enter you age please:");
Get (N);
declare
Age_Status : String := (
if N > 0 and then N < 20 then
"You are too young!"
elsif N > 19 and then N < 101 then
"You are a legal adult!"
elsif N > 100 then
"You are maybe dead?"
else
"Wow! Into the void?"
);
begin
Put_Line (Age_Status);
end;
end Main;
[link] [comments]