diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d72bc4c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f308c31 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/HotelManagement(2022).iml b/HotelManagement(2022).iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/HotelManagement(2022).iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/backup b/backup new file mode 100644 index 0000000..fd996d8 Binary files /dev/null and b/backup differ diff --git a/hotel/management/input/ScannerInput.java b/hotel/management/input/ScannerInput.java new file mode 100644 index 0000000..924d27f --- /dev/null +++ b/hotel/management/input/ScannerInput.java @@ -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); + } +} diff --git a/hotel/management/input/UserInput.java b/hotel/management/input/UserInput.java new file mode 100644 index 0000000..63d5f02 --- /dev/null +++ b/hotel/management/input/UserInput.java @@ -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; + } +} diff --git a/out/production/HotelManagement(2022)/.idea/.gitignore b/out/production/HotelManagement(2022)/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/out/production/HotelManagement(2022)/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/out/production/HotelManagement(2022)/.idea/misc.xml b/out/production/HotelManagement(2022)/.idea/misc.xml new file mode 100644 index 0000000..d72bc4c --- /dev/null +++ b/out/production/HotelManagement(2022)/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/HotelManagement(2022)/.idea/modules.xml b/out/production/HotelManagement(2022)/.idea/modules.xml new file mode 100644 index 0000000..f308c31 --- /dev/null +++ b/out/production/HotelManagement(2022)/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/out/production/HotelManagement(2022)/.idea/vcs.xml b/out/production/HotelManagement(2022)/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/out/production/HotelManagement(2022)/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/HotelManagement(2022)/Doubleroom.class b/out/production/HotelManagement(2022)/Doubleroom.class new file mode 100644 index 0000000..4e045c6 Binary files /dev/null and b/out/production/HotelManagement(2022)/Doubleroom.class differ diff --git a/out/production/HotelManagement(2022)/Food.class b/out/production/HotelManagement(2022)/Food.class new file mode 100644 index 0000000..79d5e01 Binary files /dev/null and b/out/production/HotelManagement(2022)/Food.class differ diff --git a/out/production/HotelManagement(2022)/Hotel.class b/out/production/HotelManagement(2022)/Hotel.class new file mode 100644 index 0000000..f926b1a Binary files /dev/null and b/out/production/HotelManagement(2022)/Hotel.class differ diff --git a/out/production/HotelManagement(2022)/HotelManagement(2022).iml b/out/production/HotelManagement(2022)/HotelManagement(2022).iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/out/production/HotelManagement(2022)/HotelManagement(2022).iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/HotelManagement(2022)/LICENSE b/out/production/HotelManagement(2022)/LICENSE new file mode 100644 index 0000000..2d83057 --- /dev/null +++ b/out/production/HotelManagement(2022)/LICENSE @@ -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. diff --git a/out/production/HotelManagement(2022)/Main.class b/out/production/HotelManagement(2022)/Main.class new file mode 100644 index 0000000..da2b15e Binary files /dev/null and b/out/production/HotelManagement(2022)/Main.class differ diff --git a/out/production/HotelManagement(2022)/NotAvailable.class b/out/production/HotelManagement(2022)/NotAvailable.class new file mode 100644 index 0000000..60cc0f1 Binary files /dev/null and b/out/production/HotelManagement(2022)/NotAvailable.class differ diff --git a/out/production/HotelManagement(2022)/README.md b/out/production/HotelManagement(2022)/README.md new file mode 100644 index 0000000..6c12394 --- /dev/null +++ b/out/production/HotelManagement(2022)/README.md @@ -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. diff --git a/out/production/HotelManagement(2022)/Singleroom.class b/out/production/HotelManagement(2022)/Singleroom.class new file mode 100644 index 0000000..6e02aa4 Binary files /dev/null and b/out/production/HotelManagement(2022)/Singleroom.class differ diff --git a/out/production/HotelManagement(2022)/_config.yml b/out/production/HotelManagement(2022)/_config.yml new file mode 100644 index 0000000..c741881 --- /dev/null +++ b/out/production/HotelManagement(2022)/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-slate \ No newline at end of file diff --git a/out/production/HotelManagement(2022)/backup b/out/production/HotelManagement(2022)/backup new file mode 100644 index 0000000..fd996d8 Binary files /dev/null and b/out/production/HotelManagement(2022)/backup differ diff --git a/out/production/HotelManagement(2022)/holder.class b/out/production/HotelManagement(2022)/holder.class new file mode 100644 index 0000000..1fac6bd Binary files /dev/null and b/out/production/HotelManagement(2022)/holder.class differ diff --git a/out/production/HotelManagement(2022)/write.class b/out/production/HotelManagement(2022)/write.class new file mode 100644 index 0000000..eb3a404 Binary files /dev/null and b/out/production/HotelManagement(2022)/write.class differ