comp.lang.ada
 help / color / mirror / Atom feed
From: John English <je@brighton.ac.uk>
Subject: Re: Need help for a Calculator program
Date: Fri, 01 Feb 2002 12:41:08 +0000
Date: 2002-02-01T12:40:02+00:00	[thread overview]
Message-ID: <3C5A8CE4.7CE559D@brighton.ac.uk> (raw)
In-Reply-To: ab6237e2.0202010406.48b59067@posting.google.com

Jim wrote:
> 
> ive been reading that online book
> http://www.it.bton.ac.uk/staff/je/adacraft/
> 
> it tell you how to program a calculator throughout the book, starting
> with basic adding and then going on to operator procedence(well i
> havent reached this stage yet) but the second part of the calculator
> program (chapter  ) you enter an expression eg 1 + 2 + 3 * 4.  but you
> have to end the expression with a full stop.  Is there a way where you
> dont have to enter a full stop.

You can always use Ada.Text_IO.End_Of_Line to test for the end of
the line, or read a line into a string using Ada.Text_IO.Get_Line
and then process the string, stopping when you reach the end of it.
The implementation details I leave as an exercise for the reader... :-)

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------



  reply	other threads:[~2002-02-01 12:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-01 12:06 Need help for a Calculator program Jim
2002-02-01 12:41 ` John English [this message]
2002-02-01 14:07 ` Preben Randhol
2002-02-01 18:17 ` Stephen Leake
2002-02-01 18:57   ` Jim
2002-02-01 23:20   ` Jeffrey Carter
2002-02-01 23:46 ` Jim
2002-02-02  4:12   ` Eric Merritt
2002-02-02 16:22     ` Jim
2002-02-02 12:04   ` Preben Randhol
2002-02-03 15:41 ` Jim
2002-02-04 13:54   ` Stephen Leake
2002-02-12 11:55     ` John English
2002-02-12 15:43       ` Pat Rogers
replies disabled

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