473,385 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How can I do the checkIn and find room mothed ?

Expand|Select|Wrap|Line Numbers
  1. public class Hotel {
  2.  
  3.     private Room[] rooms;    
  4.  
  5.  
  6.  
  7.     public Hotel() {
  8.         rooms = new Room[23];
  9.         int i = 0;
  10.         for(; i<5; i++) {
  11.             if (i%2==0) {
  12.                 rooms[i] = new Room(101+i, 2, "Queen", true, 150);
  13.             } else {
  14.                 rooms[i] = new Room(101+i, 1, "King", true, 135);
  15.             }
  16.         }
  17.         for(; i<20; i++) {
  18.             int number = (i/10+1)*100+1+i%10;
  19.             if (i%3==0) {
  20.                 rooms[i] = new Room(number, 1, "Queen", false, 100);
  21.             } else if (i%4==0) {
  22.                 rooms[i] = new Room(number, 1, "King", false, 125);
  23.             } else {
  24.                 rooms[i] = new Room(number, 2, "Double", false, 85);
  25.             }
  26.         }
  27.         for(; i<23; i++) {
  28.             rooms[i] = new Room(301+i%10, 4, "Queen", true, 500);
  29.         }
  30.     }
  31.     public void printRooms() {
  32.         for(int i=0; i<rooms.length; i++) {
  33.             System.out.println(rooms[i]);
  34.         }
  35.     }
  36.  
  37.  
  38.     public boolean checkIn(int room, String name, int guests, int nights) {
  39.  
  40.         // WRITE ME!
  41.  
  42.         return true;
  43.     }
  44.  
  45.  
  46.     private Room findRoom(int num) {
  47.  
  48.         // WRITE ME!
  49.  
  50.         return null;
  51.     }
  52.  
  53. }
Oct 12 '12 #1
1 1560
Rabbit
12,516 Expert Mod 8TB
This is not a code writing service and you have not explained anything about what you're trying to do. We can offer suggestions, ideas, or syntax fixes, but we are not here to do your work for you.
Oct 12 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ALIABBAS J PETIWALA | last post by:
N -ROOM LIGHTS PROBLEM ======================== THERE IS A BIG SQURE ROOM OF SIDE N WHICH CONSISTS OF N X N SMALLER SQUARE ROOMS(ARRANGED LIKE CHESS BOARD) EACH ROOM HAS A LIGHT. WHEN the...
6
by: Oliver Bleckmann | last post by:
hi there, i tried a lot, but it does not work correctly it is more copied to the substr than expected, should be only a "<tag>" but outputs "<tag>etc" shuld parse a xml file like that: <?xml...
2
by: Bassman1020 | last post by:
I am look to find information regarding barcode scanners and the programs to upload to a database. I want to be able to scan an item and see if it is in inventory. I also need to checkin items and...
0
by: =?iso-8859-1?Q?Leentje=AE?= | last post by:
Hi, i'm surching a een asp-script "room reservation" i've searched with google, without succes the good scripts are to be payed but i'm looking for a free script example: the...
2
by: sushilkaushik | last post by:
In my VC++ project (using Visual Studio 2005) I have two DLLs : CommonClasses.dll and CheckIn.dll I added both of them in exactly the same way. First, CommonClesses and then CheckIn, using...
1
by: EasyTarget | last post by:
Hello All: I am trying to write a query to determine the number of consecutive days that a conference room is available. The conference room is reserved for an entire day. People want to reserve...
2
by: digituf | last post by:
i have just create 4 tables like below : CREATE TABLE customer( customerID INT NOT NULL AUTO_INCREMENT , name VARCHAR( 30 ) , address VARCHAR( 30 ) , tel_no INT( 15 ) , email VARCHAR( 30 ) ,...
9
by: sharon pandher | last post by:
i need to find avg. time a client is spending in a certain room type in a hotel. could someone please help me how to go about it. Table fields are room type, arrival date and departure date. **...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.