Core java Ans 1
Assignment
You need to analyze the object and information structure in the given
scenario and perform the following tasks:
-> Identify the primary classes and their relationships. The primary classes should model the rooms and room bookings.
-> Create the primary classes with their required fields and methods.
import java.util.*;
class Roomctagory
{
int RoomCatagoryId;
varchar Name;
varchar Description;
float Tarrif;
}
class Booking
{
int BookingId;
varchar CustomerName;
varchar CustomerAddress;
varchar CustomerPhone;
Int RoomId;
Timestamp BookingDateTime;
Timestamp CheckinDate;
Timestamp CheckoutDate;
}
class Room
{
int RoomId;
int RoomCatagoryId;
char Status;
}
class MyClass
{
public static void main(String[] args)
{
System.out.println("RoomCatagory, Booking and Room are the three classes.");
}
}
-> Identify the primary classes and their relationships. The primary classes should model the rooms and room bookings.
-> Create the primary classes with their required fields and methods.
import java.util.*;
class Roomctagory
{
int RoomCatagoryId;
varchar Name;
varchar Description;
float Tarrif;
}
class Booking
{
int BookingId;
varchar CustomerName;
varchar CustomerAddress;
varchar CustomerPhone;
Int RoomId;
Timestamp BookingDateTime;
Timestamp CheckinDate;
Timestamp CheckoutDate;
}
class Room
{
int RoomId;
int RoomCatagoryId;
char Status;
}
class MyClass
{
public static void main(String[] args)
{
System.out.println("RoomCatagory, Booking and Room are the three classes.");
}
}
No comments:
Post a Comment