• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

UrlyBird Booking records problem

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I uploaded the Urlybird 1.3.3 assignment a few days ago and my booking method was:

Update a record in the database file by putting in the customer id in the customer id field


This is how its done:

1. The book method is invoked
2. book method calls read() which retrieves the fields
3. update the fields and then call the update method supplying the new fields
Very very simple...

Well I now realize that thats wrong; since each record in the database represent a hotel and the field "size" means the number of rooms. So you cannot simply update the record by putting in the customer id. That means you are booking the whole hotel for the customer. I think I should have created another record with size 1 and the customer id and updated the original record and decrement the size field.

Am I correct? Has anybody else made the same mistake?
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Sohrab!

Champion, the field "size" indicates how many people fits a particular room. Each record represents one room. When booking a room, only the customer ID field has to be updated. However, one good thing to be done is verify if this field is still empty before updating it.
 
sohrab khan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow that was like the fastest reply ever.

And thank you v.much for the clarification; thank god I haven't made any mistake. This means I'm gonna pass as I've done a lot a testing even cross platform testing (on fedora, ubuntu, windows).
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic