โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayAda: When the software HAS to work

What is wrong on code: String := (if statement) - image attached

What is wrong?

This happens when I add elsif, and then.

https://preview.redd.it/iolr8nsghqga1.png?width=1157&format=png&auto=webp&s=70526d475b3f2606db5fd8fccd5bb4362290b097

โ€‹

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;

submitted by /u/Ada_Noob
[link] [comments]
โŒ
โŒ