in java I want Class for admin Authorization to delete the reservation and give
ID: 3833635 • Letter: I
Question
in java I want Class for admin Authorization to delete the reservation and give a night free just this class
A hotel wants to implement a system that helps it in reservation and keeping track ofits employees and customers. The system should be able to store its employees' information in an employees' file. Each employee has a name, id, salary and a hire date, The employee can be a manager. Each manager has a list of permissions and an extra 10% to his salary. In the hotel there is a list of rooms and sweets, each room has a room number, type of bed, price and description. The sweet is a set of rooms. The hotel has special discounts in some events. The customer can chose one of these rooms cheek if it is available are not in the date he wants to reserve in. if the customer wants to take the room he has to fill in his information and he will be added to the list of customers. The customer's information is first name, last name, date of birth, email and phone number. The customers must be saved in a customers' file. To reserve a room for a customer you have to check if his age is legal are not and if the room he wants available are not. The system must also calculate the total price for the customer according to the number of nights he will stay in the room.Explanation / Answer
The question given by you is not complete.
From the question pasted, I assume you are looking for some class which will
authorize persons to delete hotel rooms etc .
For this, you can have a class as below which will return if the particular user is Admin or Not.
public class User
{
public boolean isAdministrator;
public String username;
User(name,isAdmin){
this.username = username;
this.isAdministrator = isAdmin;
}
public boolean isAdmin(){
return isAdministrator;
}
public String getUserName(){
return username;
}
}
I am not sure if you are writing a Client - Server application. If you are writing so,
then this class can be modified to get the details from the Database.
If not, then everytime a new employee is added to hotel, create an instance of this
class and assign the user name and the Admin details as applicable.
Then from the place where you want to delete the hotel rooms, you can check which user
has logged in and check his admin credentials before the deletion.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.