comp.lang.ada
 help / color / mirror / Atom feed
From: "Damon Carter" <vins@iinet.net.au>
Subject: mmmmmmmmmmmm
Date: Wed, 16 Aug 2000 12:19:10 -0700
Date: 2000-08-16T12:19:10-07:00	[thread overview]
Message-ID: <399a1b30$0$1055@echo-01.iinet.net.au> (raw)
In-Reply-To: 39998CC2.A07B01F1@NULL.lmco.com

The task i have is to write Get_Valid_Integer as a  procedure embedded in a
main program that prompts the user to enter an integer in the range between
1 and 40 and only exit when a correct value has been entered. It doesnt have
to
output to the user what the number they entered was it just has to check
that its
in the range.

They have told me that i have to use this specification-

         procedure Get_Valid_Integer (The_Integer : out Integer;
                    Prompt_Text : String := "any integer The_Integer";
                       Lower : Integer := Integer'First;
                       Upper : Integer := Integer'Last);

I have also been told that "The limits for the integer should not be
hard -wired as literal values into the subprogram code. These limits should
be communicated to the subprogram as actual parameters, received by formal
parameters, say Lower and Upper. These formal parameter values can then be
used in the subprogram to check that a value input by the user is in the
required range. They can also be outpt as part of athe prompting message,
for example, using the Image attribute:"

without using formal parameters or the procedure above i have been able to
write a program that meets all the requirements. But im meant to use formal
parameters and the Get_Valid_Integer procedure above. I dont know how to
define Lower and Upper to make the range between 1 and 40.









  reply	other threads:[~2000-08-16 19:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-15  0:00 Help!! program doesnt run, has 0 errors Damon Carter
2000-08-15  0:00 ` Gerald Kasner
2000-08-15  0:00   ` M. Kotiaho
2000-08-16 19:19     ` Damon Carter [this message]
2000-08-16  0:00       ` mmmmmmmmmmmm Preben Randhol
2000-08-16  0:00       ` mmmmmmmmmmmm Preben Randhol
2000-08-16  0:00   ` Help!! program doesnt run, has 0 errors Martin Dowie
2000-08-15  0:00 ` Gautier
replies disabled

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