comp.lang.ada
 help / color / mirror / Atom feed
From: "jimmaureenrogers@worldnet.att.net" <jimmaureenrogers@worldnet.att.net>
Subject: Re: creating an array
Date: 14 Feb 2006 14:17:35 -0800
Date: 2006-02-14T14:17:35-08:00	[thread overview]
Message-ID: <1139955455.397334.310790@g43g2000cwa.googlegroups.com> (raw)
In-Reply-To: 1139951664.264622.240870@z14g2000cwz.googlegroups.com

isaac2004 wrote:
> ok to everybody trying to help me thank you i didnt specify enough. i
> have a program that takes two inputs from prompts, the first number is
> an integer less than 10. the second number has the amount of digits
> that the previous number specifies. what i want to do is split the
> number up into single digits, sort them and out put the min ascending
> order.
>

You might think through your requirements one more time.
What happens when the first parameter does not match the number of
digits in the second parameter? If this condition is never supposed to
occur then why enter the first parameter? Simply calculate the number
of digits from the number entered and sort its digits.

Your split subprogram is a lot of work. You can achieve the same
results by converting the number to a string, which is an array of
characters. Sort that array and output the results. The 'Image
attribute will convert the number to its corresponding string
representation.

Jim Rogers




  reply	other threads:[~2006-02-14 22:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-14  6:06 creating an array isaac2004
2006-02-14 13:59 ` jimmaureenrogers
2006-02-14 15:20   ` isaac2004
2006-02-14 18:44     ` jimmaureenrogers
2006-02-14 19:25 ` Björn Persson
2006-02-14 19:39   ` Dmitry A. Kazakov
2006-02-14 21:14     ` isaac2004
2006-02-14 22:17       ` jimmaureenrogers [this message]
2006-02-14 22:30         ` isaac2004
2006-02-14 22:45         ` Ludovic Brenta
2006-02-14 22:54           ` isaac2004
2006-02-14 23:10             ` Ludovic Brenta
2006-02-14 23:37               ` isaac2004
2006-02-15  7:45                 ` Anders Wirzenius
2006-02-15 20:44                   ` Björn Persson
2006-02-16  6:59                     ` Anders Wirzenius
2006-02-15 21:53                 ` Ludovic Brenta
2006-02-15 23:29                   ` isaac2004
2006-02-16  3:09                     ` jimmaureenrogers
2006-02-15  7:42     ` Maciej Sobczak
2006-02-15 10:37       ` Jean-Pierre Rosen
2006-02-15 13:30       ` Dmitry A. Kazakov
2006-02-15 16:23         ` isaac2004
replies disabled

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