comp.lang.ada
 help / color / mirror / Atom feed
From: junior learning ADA <francois.chesnay@gmail.com>
Subject: Problem with output using Ada.Text_IO.Put
Date: Sat, 19 Jul 2014 14:37:50 -0700 (PDT)
Date: 2014-07-19T14:37:50-07:00	[thread overview]
Message-ID: <6d5e2fff-e397-4c75-a3c9-3a7825d00752@googlegroups.com> (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


             reply	other threads:[~2014-07-19 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19 21:37 junior learning ADA [this message]
2014-07-19 22:10 ` Problem with output using Ada.Text_IO.Put 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
replies disabled

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