Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions HotelManagement(2022).iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file added backup
Binary file not shown.
32 changes: 32 additions & 0 deletions hotel/management/input/ScannerInput.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package hotel.management.input;

import java.util.InputMismatchException;
import java.util.Scanner;

public class ScannerInput {

private static Scanner scanner = new Scanner(System.in);

//Used To Get Integer inputs from User
public static int getInt(){
int newInt = 0;
try{
newInt = scanner.nextInt();
}catch (InputMismatchException e){
scanner.nextLine();
}
return newInt;
}

//Used to get String inputs from User
public static String getString(){
return scanner.nextLine();
}

//Used to get character input from user
public static char getCharacter(){
String word = getString();
if(word.isBlank() || word.length() > 1) return '?';
return word.toUpperCase().charAt(0);
}
}
34 changes: 34 additions & 0 deletions hotel/management/input/UserInput.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package hotel.management.input;

public class UserInput {

//Asks for user's name
public String getName(){
String name = "";
while(name.isBlank()){
System.out.print("\nEnter customer name: ");
name = ScannerInput.getString();
}
return name;
}

//Ask for user's contact number
public String getContactNumber(){
String contactNumber = "";
while(contactNumber.isBlank()){
System.out.print("\nEnter contact number: ");
contactNumber = ScannerInput.getString();
}
return contactNumber;
}

//Ask for user's contact number
public String getGender(){
String gender = "";
while(gender.isBlank()){
System.out.print("\nEnter gender: ");
gender = ScannerInput.getString();
}
return gender;
}
}
8 changes: 8 additions & 0 deletions out/production/HotelManagement(2022)/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions out/production/HotelManagement(2022)/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions out/production/HotelManagement(2022)/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions out/production/HotelManagement(2022)/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file added out/production/HotelManagement(2022)/Food.class
Binary file not shown.
Binary file added out/production/HotelManagement(2022)/Hotel.class
Binary file not shown.
11 changes: 11 additions & 0 deletions out/production/HotelManagement(2022)/HotelManagement(2022).iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
21 changes: 21 additions & 0 deletions out/production/HotelManagement(2022)/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Shourya Jaiswal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file added out/production/HotelManagement(2022)/Main.class
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions out/production/HotelManagement(2022)/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Hotel-Management-OOP-Project

This is a Hotel Management tool which can be used to manage
activites like storing customer details, booking rooms of four different types, ordering food
for particular rooms, unbooking rooms and showing the bill. It can also be used to see
different room features and room availibility. It is a menu driven program and it runs until
the user exits. File handling has been used to store the current status of the
hotel(customer details, booked rooms, food ordered) in a file once the program exits so
that when we restart the program, the old details are not lost. The program reads the file
when it restarts to know the previous status of the hotel. Writing of file has been done in a
separate thread as it can be done parallely. User defined exception is thrown if the user
tries to book an already allotted room. Exception handling is properly done to deal with any
kind of unexpected exception.
##### Topics Covered-
Classes and Objects, Inheritance, File Handling with Objects, ArrayList, implementing
Interface, User defined exception and Exception handling.
Binary file not shown.
1 change: 1 addition & 0 deletions out/production/HotelManagement(2022)/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-slate
Binary file added out/production/HotelManagement(2022)/backup
Binary file not shown.
Binary file added out/production/HotelManagement(2022)/holder.class
Binary file not shown.
Binary file added out/production/HotelManagement(2022)/write.class
Binary file not shown.