This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: Customer number: numeric, or alpha-numeric ok? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "NX: Customer number: numeric, or alpha-numeric ok?" Watch "NX: Customer number: numeric, or alpha-numeric ok?" New topic
Author

NX: Customer number: numeric, or alpha-numeric ok?

Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
B&S contractors.
The customer number, must it be numeric, or is alpha-numeric ok?


Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
james airey
Ranch Hand

Joined: Dec 15, 2003
Posts: 41
That sounds like the sort of detail that could change from 1 version of the spec to another. If it's not specified, then I guess it's up to you.
Numeric would be more efficient in terms of memory.
Personally I think I would go with Alphanumeric, as you know it's not going to get messed about by rounding or dropping leading zeroes.
eg. if your number is 000124.500 then it may be displayed as 124.5
so if you are doing numeric, best to start with a 1, not a 0, eg 1000001, 1000002, 1000003 etc.
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
OK. Well, it's not really specified, but they say it could be the customer's social security number.
So I guess my question is, is a social security number numeric, or alpha-numeric?
J
PS (Guess you can tell I'm not from the U.S.)
[ January 23, 2004: Message edited by: Jacques Bosch ]
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Originally posted by Jacques Bosch:
So I guess my question is, is a social security number numeric, or alpha-numeric?

A Social Security number in the US is numeric only, and is usually displayed in this form: 999-99-9999.
Because the format of the customer ID is not really specified (except for length) in the assignment instructions and the supplied-database doesn't contain any customer ID's, I think you can make any reasonable assumption you wish, and as long as you document your decision you should be OK.
Hope this helps,
George


Regards, George
SCJP, SCJD, SCWCD, SCBCD
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
Yeah, it does.
Thanx again George.
J
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
Question.
My instructions say:

The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale.

OK, so it tells me that the number is 8 digits long. In the real world, this probably implies that a check must be made that the entered number is indeed 8 digits long. But then the instructions also state that the system does not interact with this number, but merely records it. So, should I check that it is 8 digits long, or not?
Terry Martinson
Ranch Hand

Joined: Oct 18, 2003
Posts: 293
I have similar spec to yours. I do check that it is numeric and the correct length.
TJ


SCJP, SCJD, SCWCD, SCBCD
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: NX: Customer number: numeric, or alpha-numeric ok?
 
Similar Threads
Java Script Validation on Applet fields
any logic to validate an email address
WA #1.....word association
How to Create a Unique 16 Character String
Html generated by JSF TAG <h:inputText/>