• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S Customer holding this record

 
paul seldon
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
< Sun's description >
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.


Why they can say clearer? Doesn it mean when the book button is pressed,
the random 8 digit number created and inserted into the column of customer holding? or Let Customer service Representative fill the arbitrary 8 digit number?


public int[] find(String[] criteria);
/1./ returns an array of record numbers that match the specified critieria.
/2./ Field n in the database file is described by criteria[n].
/3./ A null value in criteria[n] matches any field value.
/4./ A non-null value in critieria[n] matches any field value that begins with criteria[n]. (For example, "Fred", matches "Fred", "Freddy.")


I understand up to 1 and 2. what they said 3 and 4 confused with 2.
let's say table has 6 column :
No_0 | No_1 | No_2 | No_3 | No_4 | No_5 |
___________________________________________________

criteria[0] = null; // No_0 field
criteria[1] = null; // No_1 field
criteria[2] = null; // No_2 field
criteria[3] = null; // No_3 field
criteria[4] = null; // No_4 field
criteria[5] = "Fred"; // No_5 field


find method spec has input parameter as array of string.
it seems array size is the number of database field.
1 and 2 describes as if seperate search for each field.
And then 3 and 4 saying matches any field... Then why it has to be
in this seperated array criteria?


It will be really appreciated your opinion.
[ September 30, 2007: Message edited by: paul seldon ]
 
John Stone
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe they are talking about field[n] (as column) described by concrete criteria[n], and not all fields among all columns.

Here's how I understand it:


2. Field n in the database file is described by criteria[n]
example: field 3 is described by criteria c3

3. A null value in criteria[n] matches any field value.
example: a null value in criteria 3 matches all fields in column 3: r3,s3,t3,..

4. A non-null value in critieria[n] matches any field value that begins with criteria[n]
example: a non-null value in criteria 3 matches all fields in column 3, where field begins with string stored in criteria 3
 
paul seldon
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is exactly what I have understood at first.
But,

3. A null value in criteria[n] matches any field value.
example: a null value in criteria 3 matches all fields in column 3: r3,s3,t3,..


We define the field as each column. and matches all fields then logic flows to all columns...

I just need to make sure not leakage of this logic.

How about the first question?
John Stone, is it OK created with random number generator regarding customer number? or is it OK let user type the any arbitraty 8 -digit number?
 
John Stone
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We define the field as each column. and matches all fields then logic flows to all columns...


Yes, but field is always compared to corresponding criteria.
I'm sorry but I don't understand, where you see problem. Perhaps, the problem you are describing is the situation, where you have multiple non-null criteria.


John Stone, is it OK created with random number generator regarding customer number? or is it OK let user type the any arbitraty 8 -digit number?

Imagine real-life application, how would you implement it?
 
paul seldon
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what I have done is:
when user of this sw clicks the book button, dialog pop up,
that has a textfield and the user insert the number whichever it is.
(in this case, whatever... 8 digits)

and press one of the button called ok --> which close the dialog.

But, what I was concerned with is description in the paper.

< Sun's description >
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.


THE SYSTEM YOU ARE WRITING DOES NOT INTERACT WITH THESE NUMBER,
rather it simply records them.

What is the meaning here INTERACT WITH THIS NUMBER, and then record THEM?
Can one record the number without interact with this number?
Can that user (CSR) type this number be interact with this number?


It was very equivocal statement.
[ September 30, 2007: Message edited by: paul seldon ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic