• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Hotel Reservation Object Oriented  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me with this assignment?  webpage
 
Ranch Hand
Posts: 488
Chrome Linux VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help how?  What have you done?  What are you having trouble with?  What object to you think you need?
 
Master Rancher
Posts: 1162
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this post. Don't expect that people solve the assignment for you.
When posting ask direct question and show what you allready have done and if you have some errors please include the stacktrace.
 
Marshal
Posts: 63454
207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I looked at the assignment and it seems straightforward enough. You have been given five methods to implement, but you may need lots more than five. Please start by showing us what your design is.
 
Marshal
Posts: 6594
443
BSD Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@OP

Carefully remind yourself to what module you enrolled - "Object Oriented Programming I". So the problem solution needs to be an object oriented. That means you'll need to identify and create some types (classes perhaps in this case) and what they can do.

Do you remember how you identify them in some primitive way for a start?
 
Daniel Demesmaecker
Master Rancher
Posts: 1162
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually think it's a fun litle excersise for a beginner.
 
Liutauras Vilda
Marshal
Posts: 6594
443
BSD Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I merged your stuff with the following thread. I hope that is okay by you.
 
Kosu Wood
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure how to create different room types in coding
Basic >> 6 rooms in total >> $150
Deluxe >> 3 rooms in total >> $250
Penthouse >> 1 room >> $600




      My code looks like :

     


And further down in my code I implemented methods to capture the guests' data and store it. I can even choose to view all guests and what room they were assigned. However, I'm not sure how to code the room types with a fixed amount of rooms and their cost to later print how much the customer has to pay and details about their room.

 

 
Marshal
Posts: 24194
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kosu Wood wrote:Not sure how to create different room types in coding
Basic >> 6 rooms in total >> $150
Deluxe >> 3 rooms in total >> $250
Penthouse >> 1 room >> $600



Those things are all attributes of a room. At minimum you need something which can say "This room is a Deluxe room". So there should be an attribute of the Room class which you can use for that, and you would be setting that attribute in that code (which you already have) which creates the Room objects.

The design of the Room class may also allow you to specify the dollar amount of the room (perhaps that's the nightly rate?), or there might be a RoomType class which has "nightly rate" as an attribute. In the latter case a Room object would have a RoomType.

You haven't said whether you're being given the Room class and are just being asked to write code which works with it, or whether you're also responsible for the design.
 
Campbell Ritchie
Marshal
Posts: 63454
207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:. . . whether you're also responsible for the design.

It would probably be a good idea to show us your design, whether you made it yourself or were given it, before you try any code.
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!