comp.lang.ada
 help / color / mirror / Atom feed
* Problem with output using Ada.Text_IO.Put
@ 2014-07-19 21:37 junior learning ADA
  2014-07-19 22:10 ` Jerry
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: junior learning ADA @ 2014-07-19 21:37 UTC (permalink / raw)


I am starting to learn ADA and I have installed Adacore gnat 2014. 

I am using the source codes from M.B. Feldman and E.B. Koffman, Ada 95 Problem Solving and Program Design, 3rd edition.

In this respect, there appears to be a problem with Ada.Text_IO.Put and Ada.Integer_Text_IO.Get. The issue is that the text output only appears after the Ada.Integer_Text_IO.Get (Item => Nickels);

Please see extract from program:

BEGIN -- Coin_Collection

  -- prompt user for number of nickels and pennies
  Ada.Text_IO.Put (Item => "How many nickels do you have? ");
  Ada.Integer_Text_IO.Get (Item => Nickels);
  Ada.Text_IO.Put (Item => "How many pennies do you have? ");
  Ada.Integer_Text_IO.Get (Item => Pennies);
  Ada.Text_IO.New_Line;


However, when I run the program the text output appears after the questions. See below:
/Users/francois/Documents/ADA/test/fk3-w95/coin_collection
1
2
How many nickels do you have? How many pennies do you have? 
[2014-07-19 22:05:16] process terminated successfully, elapsed time: 16.28s

I guess my explanation is not very clear, but what I would have expected the program to do is:
How many nickels do you have? 
(then we enter 1 for example)
How many pennies do you have? 
(then we enter 2 for example)

Is the issue coming from using a newer version of ADA?

Francois


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-07-20 14:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-19 21:37 Problem with output using Ada.Text_IO.Put junior learning ADA
2014-07-19 22:10 ` Jerry
2014-07-19 23:58 ` Jeffrey Carter
2014-07-20  5:22 ` Niklas Holsti
2014-07-20  6:52   ` junior learning ADA
2014-07-20  7:00     ` junior learning ADA
2014-07-20 14:51       ` Niklas Holsti
2014-07-20  8:53     ` Georg Bauhaus
2014-07-20 10:36     ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox