My code so far. It does not work however. I would like to be able to write something like "go", "car" or "truck", as long as it's 5 characters or less, and the programme will then write that word out. I think i need to use Get_Line an Put_Line but i do not know how to use them.
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Ada_O1_1 is
I : Integer;
S : String(1..5);
begin
Put("Write a string with a maximum of 5 characters: ");
Get(S, Last =>I);
Put("You wrote the string: ");
Put(S(1..I));
end Ada_O1_1;
I put this in the form of a loop, which (a) makes using it slightly easier, (b) adds the need for handling empty and over-length inputs.