comp.lang.ada
 help / color / mirror / Atom feed
From: Preben Randhol <randhol+abuse@pvv.org>
Subject: Re: Need help for a Calculator program
Date: Sat, 2 Feb 2002 12:04:45 +0000 (UTC)
Date: 2002-02-02T12:04:45+00:00	[thread overview]
Message-ID: <slrna5novj.2cs.randhol+abuse@kiuk0152.chembio.ntnu.no> (raw)
In-Reply-To: a3f9bv$shm$1@knossos.btinternet.com

On Fri, 1 Feb 2002 23:46:07 +0000 (UTC), Jim wrote:
> ok, i think im gonna start this program again and try not to follow the book
> as im not understang the 'calculator' well enough.
> 
> can someone give me some steps in designing a calculator, do i need to use
> loops, do i need to use arrays etc that kind of thing.

I don't know how this program works, but if I wanted to make a
calculator I would like to have one that reads what I write until I
press the <RETURN> key like:

   2 + 3 * ( 6 / 7) - log(5)<RETURN>

To get this I would read what the user types by a Get_Line statement.
Get_Line will wait until you hit return. Now you use Get on this string
to find all the operands etc. You can thus keep the old code (you can
just add . to the string the user typed).

Preben



  parent reply	other threads:[~2002-02-02 12:04 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
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 [this message]
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