This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S: Customer ID Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S: Customer ID" Watch "B&S: Customer ID" New topic
Author

B&S: Customer ID

Muhammad Shafique
Ranch Hand

Joined: Sep 30, 2006
Posts: 57
Hi there,
Specifications says:

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.

Does it mean that customer id MUST have all eight digits without leading zeros? OR at max. 8 digits and min. 1 (excluding zero)?

It seems sticking to all 8 digits is a better option. Please comment!

Thanks
Shafique
Brian Kelly
Ranch Hand

Joined: Jan 04, 2007
Posts: 54
Hi Muhammad,

Funnily enough, I coded that yesterday.

I read it that it MUST be 8 digits (including 0), so "00000001" is okay but "1" is not.

I just used a JFormattedTextField with MaskFormatter("########").

And "0" is a digit according to MaskFormatter (the API says # "is Any valid number, uses Character.isDigit").


SCJA, SCJP (1.4), SCJD
Muhammad Shafique
Ranch Hand

Joined: Sep 30, 2006
Posts: 57
Thanks Brian,
JFormattedTextField is cool for text formatting.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S: Customer ID
 
Similar Threads
Customer ID: strictly 8 digits?
question on B&S Gui
B&S: Customer ID (owner) exact 8 digits or not?
Reservation-1 to 8 digits
NX: Customer number: numeric, or alpha-numeric ok?