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 48 hrs -- Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "48 hrs -- Please help" Watch "48 hrs -- Please help" New topic
Author

48 hrs -- Please help

Peter Yunguang Qiu
Ranch Hand

Joined: Nov 22, 2003
Posts: 99
quote from Terry's posting:
The application allows bookings for any room an any time with no date checking. It even allows users to book rooms for dates in the past."
I am confused. If a room's available date is last year(say 2003/04/25), and now(2004/04/17) the room is empty(No owner), a customer can NOT book this room right now?
My understanding is:
today is 2004/04/17, any rooms that date on 2004/04/19 or before is available for booking, as long as it is empty(NO owner).
According to the assignment specification, what date ranges are OK for booking today(2004/04/17)?
The db file doesn't have a field of "date starting occupancy"(the date customer needs the room).
I am totally confused.
Anyone can give me some explanation? Thanks.


Peter
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Peter,
I am confused. If a room's available date is last year(say 2003/04/25), and now(2004/04/17) the room is empty(No owner), a customer can NOT book this room right now?

No, a CSR shouldn't be able to book a room with a past date. Isn't it common sense? Would you, as a customer, want to pay for a hotel room which *was* available, let's say last year?
The instructions are quite clear:
They sell accomodations for business and pleasure travellers at short notice, helping hotels to fill rooms that would otherwise be left empty. They take bookings only within 48 hours of the start of room occupancy.

It means that a room is only available for booking between now and now + 2 days.
According to the assignment specification, what date ranges are OK for booking today(2004/04/17)?

If we're now on 2004/04/17, rooms are available for booking if their "date available" field value falls in the range 2004/04/17-2004/04/19.
The db file doesn't have a field of "date starting occupancy"(the date customer needs the room).

The field you're looking for is this one:

Now there is a problem with that rule. How will you (and your grader) be able to test booking with the provided data? If you hard-code the rule, it's simply impossible. That's why I suggested to abstract that time range through two properties: see here.
Regards,
Phil.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11279
    
  59

Hi Phil,

The instructions:
They sell accomodations for business and pleasure travellers at short notice, helping hotels to fill rooms that would otherwise be left empty. They take bookings only within 48 hours of the start of room occupancy.
Phil
It means that a room is only available for booking between now and now + 2 days.

Well, technically I suppose it also means you can purchase a a room that was available in the previous 2 days
I could make a case where booking a room up to 24 hours in the past might make sense if you were using the clock on the client to determine the current date, and you were about to travel across the international date line (in the past I have shown that there is at least one flight that arrives in America the day before it leaves Sydney ).
But dealing with the international date line is far beyond the scope of this assignment, IMHO.
Best Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Andrew,
Well, technically I suppose it also means you can purchase a a room that was available in the previous 2 days
I could make a case where booking a room up to 24 hours in the past might make sense if you were using the clock on the client to determine the current date, and you were about to travel across the international date line (in the past I have shown that there is at least one flight that arrives in America the day before it leaves Sydney ).
But dealing with the international date line is far beyond the scope of this assignment, IMHO.

Right! And that's an additional argument in favor of making the 48-hours rule dependant on properties like I suggest.
Best regards,
Phil.
Peter Yunguang Qiu
Ranch Hand

Joined: Nov 22, 2003
Posts: 99
Thank you very much Philippe and Andrew.
My understanding is: the date available is not the date that customer want to occupy it. Therefore, it is not the date customer start to pay for it. For example, a room's available date is 2003/04/25, I book it on 2004/04/17 but I wnat to occupy it on 2004/04/19. I will pay for it on and after 2004/04/19.
The room has been empty since 2003/04/25. If the customer cannot book this room, the room will be empty forever?
By the common sense(or from common business perspective), the reservation of hotel room should hava a field for date the customer plan to occupy it. 48 hrs rule should mean: the customer book the room on 2004/04/17, he can book rooms that available date are on or before 2004/04/19, and he can occupy the room on 2004/04/17, 2004/04/18, 2004/04/19 and starting to pay for the room on the day he occupy it.
Am I wrong? Any comments?
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11279
    
  59

Hi Peter,
Check your instructions. Mine specify the date field as:

The single night to which this record relates, format is yyyy/mm/dd.

So your example:

For example, a room's available date is 2003/04/25, I book it on 2004/04/17 but I wnat to occupy it on 2004/04/19.

is wrong. The room is available (not booked) on the single night of the 25th April, 2003. You cannot tell from this whether it is available on subsequent nights or not.
Regards, Andrew
Min Huang
Ranch Hand

Joined: Mar 17, 2004
Posts: 100
My understanding is: the date available is not the date that customer want to occupy it.

It is is the date he wants to occupy the room.

Therefore, it is not the date customer start to pay for it. For example, a room's available date is 2003/04/25, I book it on 2004/04/17 but I wnat to occupy it on 2004/04/19. I will pay for it on and after 2004/04/19.

Don't worry about payment details. If a room's availability date is is 2003/04/25, the expected course of action is:
1) Between 2003/04/23 and 2003/04/25 a customer calls and the CSR books the room.
2) Sometime after the booking the customer pays for it (again, don't worry about it).
3) On 2003/04/25 the customer arrives at the hotel and stays at the room.

The room has been empty since 2003/04/25. If the customer cannot book this room, the room will be empty forever?

The assignment is not clear on this. Technically, as Andrew says, it will be empty for two days after 2003/04/25, and after that nobody should be able to book it.
I just want to add that while Andrew's logic is correct, a fellow rancher, Terry Martinson, was penalized for allowing booking to take place AFTER the date of availability has passed (although he subsequently appealed and won). In my opinion, it's not worth the hassle and it's better to simply assume that the only timeframe where a room is bookable is 48 hours before it's available. In the example above that would be between 2003/04/23-2003/04/25.

By the common sense(or from common business perspective), the reservation of hotel room should hava a field for date the customer plan to occupy it. 48 hrs rule should mean: the customer book the room on 2004/04/17, he can book rooms that available date are on or before 2004/04/19, and he can occupy the room on 2004/04/17, 2004/04/18, 2004/04/19 and starting to pay for the room on the day he occupy it.
Am I wrong? Any comments?

A customer can only occupy the room on the date of that room's availability.


SCJP 1.4, SCJD 1.4, SCBCD (Preparing!)
Peter Yunguang Qiu
Ranch Hand

Joined: Nov 22, 2003
Posts: 99
Hi, Min Huang,
Thank you.
I just want to add that while Andrew's logic is correct, a fellow rancher, Terry Martinson, was penalized for allowing booking to take place AFTER the date of availability has passed (although he subsequently appealed and won). In my opinion, it's not worth the hassle and it's better to simply assume that the only timeframe where a room is bookable is 48 hours before it's available. In the example above that would be between 2003/04/23-2003/04/25.
Yes, your opinion is the best choice. We just want to receive full cridit on the 48 hr issue. We don't need to care about how bad the business rule is, or if this Bird Hotel would go bankrupt because most of the rooms in it are not bookable and keep empty.
48 -- a simple number for pupils but gave some rancher(including me) hard time and some rancher even failed the exam.
By the way, are you From Asia? Where are you
Peter Yunguang Qiu
Ranch Hand

Joined: Nov 22, 2003
Posts: 99
Thanks Phil and Andew.
It means that a room is only available for booking between now and now + 2 days.
Is this the rule the can let us get full credit on the 48 hr issue? If it is, I will follow it.
Min Huang
Ranch Hand

Joined: Mar 17, 2004
Posts: 100
Thanks Phil and Andew.
quote:
--------------------------------------------------------------------------------
It means that a room is only available for booking between now and now + 2 days.
--------------------------------------------------------------------------------
Is this the rule the can let us get full credit on the 48 hr issue? If it is, I will follow it.

I think what Philippe means is booking is available between "date available - 2 days" and "date available".
And yes, you are correct in your guess that I am from Asia. You'd probably even guess that I'm from China or Taiwan (and you'd be right). And I would guess that you're from China or Taiwan too.
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Peter,
I think that Min's interpretation of the rule is correct.
But - I insist a bit - make sure that your application still can be tested by your grader! (See my last comment in my first post in this thread).
Regards,
Phil.
Peter Yunguang Qiu
Ranch Hand

Joined: Nov 22, 2003
Posts: 99
Hi, Philippe: Thank you.
Hi, Min Huang( or Huang Min, 黄敏 :
From you name, I can guess you are a Chinese, but there is no clue for me to know you are from Taiwan or China just by name. I am from main land of China. I hava some relatives(My father's relatives) in Taiwan but I've never seen them. Nice to meet you here.
Min Huang
Ranch Hand

Joined: Mar 17, 2004
Posts: 100
Hi, Philippe: Thank you.
Hi, Min Huang( or Huang Min, 黄敏 :
From you name, I can guess you are a Chinese, but there is no clue for me to know you are from Taiwan or China just by name. I am from main land of China. I hava some relatives(My father's relatives) in Taiwan but I've never seen them. Nice to meet you here.

Good guess, but it's actually wen under a ri (sorry, I don't have Chinese IME installed anymore). Anyhoo, I'm from mainland as well, nice to meet you. Cheers and beers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 48 hrs -- Please help
 
Similar Threads
UrlyBird : question about the owner
48 hours rule
Passed SCJD with 390 / 400 (97,5%)
UrlyBird - they take booking only within 48 hours...
NX: 48 hour Auto failure