File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S: Customer ID" Watch "B&S: Customer ID" New topic

B&S: Customer ID

Muhammad Shafique
Ranch Hand

Joined: Sep 30, 2006
Posts: 59
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!

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").

Muhammad Shafique
Ranch Hand

Joined: Sep 30, 2006
Posts: 59
Thanks Brian,
JFormattedTextField is cool for text formatting.
I agree. Here's the link:
subject: B&S: Customer ID
It's not a secret anymore!