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
106 changes: 106 additions & 0 deletions Code_Hotel_management/AddDrivers.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package Hotel_management;
import java.util.*;
class Drivers{
String name,gender,age,car_company,car_brand,location;
boolean available;
public Drivers(String name,String age,String comp,String brand,String loc,boolean avail){
this.name=name;
this.age=age;
this.car_company=comp;
this.car_brand=brand;
this.location=loc;
this.available=avail;
}
}
public class AddDrivers {
Drivers d;
static ArrayList<Drivers> driv=new ArrayList<>();
void accept_Drivers()
{
Scanner sc=new Scanner(System.in);

System.out.println("NAME:");
String name = sc.next();
System.out.println("AGE:");
String age = sc.next();
System.out.println("CAR COMPANY:");
String car_company = sc.next();
System.out.println("CAR BRAND:");
String car_brand = sc.next();
System.out.println("LOCATION");
String location = sc.next();
System.out.println("AVAILABILITY(true/false):");
boolean available =sc.nextBoolean();
d=new Drivers(name,age,car_company,car_brand,location,available);
driv.add(d);
System.out.println("DRIVER ADDED SUCCESSFULLY!!!!\n\n"); }
void display_Drivers()
{
System.out.printf("%-15s","NAME");
System.out.printf("%-10s","AGE");
System.out.printf("%-20s","CAR_COMPANY");
System.out.printf("%-20s","CAR_BRAND");
System.out.printf("%-20s","LOCATION");
System.out.printf("%-20s","AVAILABLE");
System.out.println("\n______________________________________________________________________________________________________________");

for(int i=0;i<driv.size();i++) {
System.out.printf("%-15s",driv.get(i).name);
System.out.printf("|%-10s",driv.get(i).age);
System.out.printf("|%-15s",driv.get(i).car_company);
System.out.printf("|%-20s",driv.get(i).car_brand);
System.out.printf("|%-20s",driv.get(i).location);
System.out.printf("|%-20s",driv.get(i).available);

System.out.println("\n______________________________________________________________________________________________________________");

}

}
void display_Managers()
{
System.out.println("NAME\t\t AGE\t\t\tGENDER\t\t\tJOB\t\t\tSALARY\t\t PHONE\t\t\tAADHAR\t\t\t GMAIL");
System.out.println("____________________________________________________________________________________________________________");
String name1="RAJ JAIN";
String name2="KUNAL DEY";
String age1= "25";
String age2= "30";
String Gender1="MALE";
String Gender2="MALE";
String Job1="Manager";
String Job2="Manager";
String Salary1="Rs.1,00,000";
String Salary2="Rs.1,20,000";
String Phone1="9987654321";
String Phone2="1234567890";
String Aadhar1="9988776655";
String Aadhar2="1122334455";
String Gmail1="Raj.jain@gmail.com";
String Gmail2="kunal.dey@gmail.com";
System.out.printf("%-20s",name1);
System.out.printf("|%-20s",age1);
System.out.printf("|%-20s",Gender1);
System.out.printf("|%-20s",Job1);
System.out.printf("|%-20s",Salary1);
System.out.printf("|%-20s",Phone1);
System.out.printf("|%-20s",Aadhar1);
System.out.printf("|%-20s",Gmail1);
System.out.println();
System.out.printf("%-20s",name2);
System.out.printf("|%-20s",age2);
System.out.printf("|%-20s",Gender2);
System.out.printf("|%-20s",Job2);
System.out.printf("|%-20s",Salary2);
System.out.printf("|%-20s",Phone2);
System.out.printf("|%-20s",Aadhar2);
System.out.printf("|%-20s",Gmail2);
System.out.println("____________________________________________________________________________________________________________");
}
public static void main(String[] args) {
AddDrivers d=new AddDrivers();
d.display_Managers();
d.accept_Drivers();
d.display_Drivers();
}

}
94 changes: 94 additions & 0 deletions Code_Hotel_management/AddEmployee.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package Hotel_management;


import java.util.*;
class Employees{
String name,age,salary,phone,aadhar,email,gender;
public Employees(String name,String age,String s,String p,String a,String e,String gender){
this.name=name;
this.age=age;
this.salary=s;
this.phone=p;
this.aadhar=a;
this.email=e;
this.gender=gender;
}
}
public class AddEmployee {
Employees e;
static ArrayList<Employees> emp=new ArrayList<>();

public void accept_Employees()
{
if(emp.size()==0) {
emp.add(0,new Employees("Lily","34","25000","6758456798","134566577465","lily@gmail.com","F"));
emp.add(1,new Employees("Ron","23","670000","6753243598","989343875435","ron@gmail.com","M"));
emp.add(2,new Employees("Harry","56","805000","2748385457","909566577465","harry@gmail.com","M"));
emp.add(3,new Employees("Pearl","24","125000","9058456788","774566577488","pearl@gmail.com","F"));
emp.add(4,new Employees("Serah","33","29000","8756556790","564566577488","searh@gmail.com","F"));
}
Scanner sc=new Scanner(System.in);
String gender = null;
System.out.println("NAME:");
String name = sc.next();
System.out.println("AGE:");
String age = sc.next();
System.out.println("SALARY:");
String salary = sc.next();
System.out.println("PHONE:");
String phone = sc.next();
if(phone.length()!=10) {
System.out.println("ENTER A VALID 10 DIGIT NUMBER!!!");
new Dashboard().display();
}
System.out.println("AADHAR:");
String aadhar = sc.next();
if(aadhar.length()!=12) {
System.out.println("ENTER A VALID 12 DIGIT NUMBER!!!");
new Dashboard().display();
}
System.out.println("EMAIL:");
String email = sc.next();
System.out.println("GENDER(F/M):");
gender=sc.next();
e=new Employees(name,age,salary,phone,aadhar,email,gender);
emp.add(e);
System.out.println("---EMPLOYEE ADDED SUCCESSFULLY");
}
public void display_Employees()
{
if(emp.size()==0) {
emp.add(0,new Employees("Lily","34","25000","6758456798","134566577465","lily@gmail.com","F"));
emp.add(1,new Employees("Ron","23","670000","6753243598","989343875435","ron@gmail.com","M"));
emp.add(2,new Employees("Harry","56","805000","2748385457","909566577465","harry@gmail.com","M"));
emp.add(3,new Employees("Pearl","24","125000","9058456788","774566577488","pearl@gmail.com","F"));
emp.add(4,new Employees("Serah","33","29000","8756556790","564566577488","searh@gmail.com","F"));
}
System.out.printf("%-15s","NAME");
System.out.printf("%-10s","AGE");
System.out.printf("%-20s","SALARY");
System.out.printf("%-20s","PHONE");
System.out.printf("%-20s","AADHAR");
System.out.printf("%-20s","EMAIL");
System.out.printf("%-20s","AGE");
System.out.println("\n______________________________________________________________________________________________________________");

for(int i=0;i<emp.size();i++) {
System.out.printf("%-15s",emp.get(i).name);
System.out.printf("|%-10s",emp.get(i).age);
System.out.printf("|%-15s",emp.get(i).salary);
System.out.printf("|%-20s",emp.get(i).phone);
System.out.printf("|%-20s",emp.get(i).aadhar);
System.out.printf("|%-20s",emp.get(i).email);
System.out.printf("|%-20s",emp.get(i).gender);

System.out.println("\n______________________________________________________________________________________________________________");

}
}
public static void main(String[] args) {
AddEmployee e=new AddEmployee();
e.display_Employees();
}

}
129 changes: 129 additions & 0 deletions Code_Hotel_management/AddRoom.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package Hotel_management;
import java.util.Scanner;

public class AddRoom
{
public void Add_Rooms()
{
int x=1;
int flag=0;
int num;
String ava="";
String sta="";
int price;
String typ="";
Room[] obj=new Room[5];
Dashboard d = new Dashboard();
Scanner sc=new Scanner(System.in);
obj[0]=new Room(1,"unavailable","cleaned",1000,"Single bed");
obj[1]=new Room(2,"unavailable","cleaned",2000,"Double bed");
obj[2]=new Room(3,"available","cleaned",1000,"Single bed");
obj[3]=new Room(4,"available","cleaned",2000,"Double bed");
obj[4]=new Room(5,"available","cleaned",1000,"Single bed");

SearchRoom sr=new SearchRoom();
UpdateRoom ur=new UpdateRoom();
for (Room room : obj)
{
sr.addRoom(room);
ur.addRoom(room);
}
do
{
System.out.println("ENTER 1.TO DISPLAY ROOMS");
System.out.println("ENTER 2.FOR ADDING A ROOM");
System.out.println("ENTER 3.TO SEARCH A ROOM");
System.out.println("ENTER 4.UPDATE A ROOM");
System.out.println("ENTER 0.EXIT");
x=sc.nextInt();
switch(x)
{
case 1:
ur.display();
break;

case 2:

System.out.println("ADD A ROOM");
System.out.println("Enter room number : ");
num=sc.nextInt();
for (Room room : obj) {
if(room.getroomnum()==num)
{
flag=1;
}
}
if(flag==1)
{
System.out.println("Room number already exists");
d.display();
}
System.out.println("Enter 1:available 2:booked");
int available=sc.nextInt();
if(available != 1 && available != 2)
{
System.out.println("you entered wrong choice");
d.display();
}
else if(available==1)
{
ava="available";
}
else
{
ava="unavailable";
}
System.out.println("Enter 1:cleaned 2:uncleaned : ");
int status=sc.nextInt();
if(status != 1 && status != 2)
{
System.out.println("you entered wrong choice");
d.display();
}
else if(status==1)
{
sta="cleaned";
}
else
{
sta="uncleaned";
}
System.out.println("Enter price : ");
price=sc.nextInt();
System.out.println("Enter the type of room : ");
System.out.println("1.Single bed 2.Double bed");
int type=sc.nextInt();
if(type != 1 && type != 2)
{
System.out.println("you entered wrong choice");
d.display();
}
else if(type==1)
{
typ="Single bed";
}
else
{
typ="Double bed";
}
Room r1=new Room(num,ava,sta,price,typ);
sr.addRoom(r1);
ur.addRoom(r1);
break;

case 3:
sr.search();
break;

case 4:
ur.update();
ur.display();
break;

case 0:
d.display();
}

}while(x != 0);
}
}
Loading