Title: RE: [jdjlist] Re: J2ME
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:

  1. the value of one digit character; and
  2. 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:

input output
0 zero
3 three
13 thirteen
23 twenty-three
223223 two hundred and twenty-three thousand, two hundred and twenty-three
223223223 two hundred and twenty-three million, two hundred and twenty-three thousand, two hundred and twenty-three
>2147483647 two billion, one hundred and forty-seven million, four hundred and eighty-three thousand, six hundred and forty-seven
-1 minus one

Your program must have three function methods that respectively return:

  1. a value between 1 and 9 in words;
  2. a value between 1 and 999 in words; and
  3. 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

Reply via email to