File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 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!

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: 59
Thanks Brian,
JFormattedTextField is cool for text formatting.
 
 
subject: B&S: Customer ID
 
Similar Threads
question on B&S Gui
Customer ID: strictly 8 digits?
NX: Customer number: numeric, or alpha-numeric ok?
B&S: Customer ID (owner) exact 8 digits or not?
Reservation-1 to 8 digits