Disclaimer: I am in a Computer Science class, but it’s not as if this is the answer to a homework problem. It is a general question.
I understand that this is probably an extremely simple thing to do. I am using ADA, and specific advice would be great, but general programming advice will be fine too, as I feel once I get this concept, I can apply it myself.
So I want to take an input of a string of characters (letters or numbers, but in this case numbers), and be able to manipulate the characters seperately (ie store each one to a seperate variable).
The approach I think might work is defining the variables as character type and calling a text_io.get for each character one after another, without any puts or new lines. Unfortunately, I have been unable to configure gnat-gps on my home computer, so I can not test this theory right now.
To clarify, my code might look something like this:
First : Character Second : Character Third : Character BEGIN Ada.Text_IO.Put("Enter a three digit number"); Ada.Integer_Text_IO.Get(item => First); Ada.Interger_Text_IO.Get(item => Second)
Any specific ADA or general object-oriented programming advice would be much appreciated.