Greg,

Hm... Do you think it would be better to use a right-to-left approach?

Derek Ngok

-----Original Message-----
From: Greg Gent [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 6:32 AM
To: JDJList
Subject: [jdjlist] RE: two exercises


Tim,

I think you have already been "helped".  The programming in the number to
text problem IS really quite trivial.  The difficulty, as with most
programming tasks, lies in the ability to break the problem down into
smaller solveable pieces.  Ironically enough the pieces which do, indeed,
make sense were stated in the problem description.

For example...
Decide how you would solve the problem of naming a number between 1 and 999.

Once you have this solution the same algorithm can be used for each
subsequent group of 10^3 digits (thousands, millions, billions, etc.).

Note that this is exactly the reasoning that you go through when you decide
how to read the number.  For example, you know that for 123 numText = "one
hunbred twnty three".  When it happens to be that the "123" text is in
thousands positions..123,XXX you simply append thousand to numText, etc.

Break the problem down.  Similar reasoning can be used to solve the hunreds
digit as well.

HTH

-----Original Message-----
From: Tim Nicholson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 10:12 AM
To: JDJList
Subject: [jdjlist] two exercises


Joseph,

I should point out that there are no *grades* for these exercises for me. I
am trying to grasp these problems on my own AND I AM NOT GETTING GRADES FOR
THIS.

I am merely trying to understand what an approach can be taken toward these
problems. I do not know how to do them myself and they, I am told are in
fact for more advanced programmers while I am just a beginner level
programmer.

So on that basis, can I ask if you could kindly help with these ?


----- Original Message -----
From: "Joseph Ottinger" <[EMAIL PROTECTED]>
To: "JDJList" <[EMAIL PROTECTED]>
Sent: Wednesday, September 25, 2002 8:42 PM
Subject: [jdjlist] Re: two exercises I am trying to solve at the moment....


> >From: "Tim Nicholson" <[EMAIL PROTECTED]>
> >Subject: [jdjlist] Re: two exercises I am trying to solve at the
moment....
> >
> >Are you saying that you actually got programming questions when you were
in
> >grade 9 ?
>
> Yeah. Apple ][ and the Commodore 64, baby.
>
> >From where i come from, it is unheard of to have done any sort of
> >programming until you reach university level.
>
> *Joe sees the tech lead of the US get just a little safer*
>
> >So are you suggesting that you studied programming while you were still
at
> >high school ?
> >I would be very interested to hear about that....?
>
> Not much to it. I've been programming since I was 13, back on the TRS
Model
> III or so, then got my ZX-81 (Well, okay, Timex/Sinclair 1000 with the 16K
> addon.)
>
> >Joseph, is it possible to provide some coded solution segments for these
2
> >problems ? Particularly the ones to do with the computer saying in words
> >what you type in as an int.
>
> Sure it's possible. Will I do it? No. You earn your own grades.
>
> >I would much appreciate if you  could possibly provide a solution that I
> >can
> >then study myself and see what sort of things you were doing in them so
> >that
> >I can learn from the solution ?
> >
> >I would appreciate your help ?
> >
> >
> >----- Original Message -----
> >From: "Joseph B. Ottinger" <[EMAIL PROTECTED]>
> >To: "JDJList" <[EMAIL PROTECTED]>
> >Sent: Wednesday, September 25, 2002 8:12 PM
> >Subject: [jdjlist] Re: two exercises I am trying to solve at the
moment....
> >
> >
> > > RE: [jdjlist] Re: J2MEWell, Tim, the first step is to read the
> >suggestions
> > > made by your coursework. Start small; write functions that do the
simple
> > > stuff first. Break the problems down (although most of the work has
been
> > > done for you already.) Man, these questions have gotten easier since
*I*
> >was
> > > in grade 9.
> > >
> > > ----- Original Message -----
> > > From: Tim Nicholson
> > > To: JDJList
> > > Sent: Wednesday, September 25, 2002 4:09 AM
> > > Subject: [jdjlist] two exercises I am trying to solve at the
moment....
> > >
> > >
> > > Hi everyone again,
> > >
> > > this is in addition to the previous email that I sent but this is on a
> > > rather different topic.
> > >
> > > I am trying to work through some problems/exercises and I was
wondering
> >if
> > > anyone might be able to suggest how I might be able to solve these
> >problems
> > > ?
> > >
> > > Like I said before, this email is on a different topic to the email
that
> >I
> > > sent before.
> > >
> > > The 1st problem I was wondering if anyone could help me on is as
follows
> >:-
> > >
> > >
========================================================================
> > >
> > > Design and implement a program that allows the user to input a number
in
> >any
> > > base (2..16) as a string of digits (0..9, A..F) and the base that the
> >number
> > > is in and displays the value in decimal of the input number.
> > > Your program must have two function methods that respectively return:
> > > the value of one digit character; and
> > > the value of a whole string of digits in a given base.
> > > Hint: The first of those functions makes it easier to write the
second.
> > > Your program may have a BreezySwing or text-only interface
> > >
> > >
========================================================================
> > >
========================================================================
> > > And the second one is like this :-
> > >
=======================================================================
> > > Write a program that allows the user to input any int value and
outputs
> >that
> > > number in words.
> > > Examples:
> > > inputoutput
> > > 0zero
> > > 3three
> > > 13thirteen
> > > 23twenty-three
> > > 223223two hundred and twenty-three thousand, two hundred and
> >twenty-three
> > > 223223223two hundred and twenty-three million, two hundred and
> >twenty-three
> > > thousand, two hundred and twenty-three
> > > >2147483647two billion, one hundred and forty-seven million, four
> >hundred
> > > and eighty-three thousand, six hundred and forty-seven
> > > -1minus one
> > >
> > > Your program must have three function methods that respectively
return:
> > > a value between 1 and 9 in words;
> > > a value between 1 and 999 in words; and
> > > any int value in words.
> > > Hint: The first of those functions makes it easier to write the second
> >and
> > > writing the second will help write the third.
> > > Good solutions may have even more functions.
> > >
> >=========================================================================
> > >
========================================================================
> > > I really don't have a clue how to solve these so any help as to what
> >sort
> >of
> > > algorithm and java code implementation that I could use, would be very
> >much
> > > appreciated.
> > >
> > >
> > > To change your JDJList options, please visit:
> > > http://www.sys-con.com/java/list.cfm
> > >
> > > To change your JDJList options, please visit:
> >http://www.sys-con.com/java/list.cfm
> > >
> >
> >
> >
> >To change your JDJList options, please visit:
> >http://www.sys-con.com/java/list.cfm
>
>
> -----------------------------------------------
> Joseph B. Ottinger       [EMAIL PROTECTED]
> http://enigmastation.com          IT Consultant
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
>



To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm

______________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Reply via email to