Create a class named Person that holds the following fields: two String objects for the person’s first and last name and a LocalDate object for the person’s birth date. Create a class named Couple that contains two Person objects. Create a class named Wedding for a wedding planner that includes the date of the wedding, the Couple being married, and a String for the location.
Provide constructors for each class that accept parameters for all fields where the argument variables are the same names as the instance variables, and the "this" variable is used, and provide get methods for each field.
Create a program (or demo class) called WeddingDemo that utilizes the Person, Couple, and Wedding classes. It should have a test() method to create 2 Wedding objects (and the required Person and Couple objects as well) and then displays the wedding information. It should have a display() method to display information about the wedding, and an askUser() method to prompt the user for information to create a Wedding object, and then display that information back to the user. For basic credit (100%), you may hardcode the birthdates and wedding date in the askUser() method.
/************************Person.java****************************************8/
import java.util.Date;
public class Person {
private String firstName;
private String lastName;
private Date birthDate;
/**
*
* @param firstName
* @param lastName
* @param birthDate
*/
public Person(String firstName, String lastName, Date
birthDate) {
super();
this.firstName = firstName;
this.lastName = lastName;
this.birthDate = birthDate;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Date getBirthDate() {
return birthDate;
}
}
/*******************************Couple.java**************************************/
public class Couple {
private Person person1;
private Person person2;
/**
*
* @param person1
* @param person2
*/
public Couple(Person person1, Person person2) {
super();
this.person1 = person1;
this.person2 = person2;
}
public Person getPerson1() {
return person1;
}
public Person getPerson2() {
return person2;
}
}
/******************************************Wedding.java********************************************/
import java.util.Date;
public class Wedding {
private Date dateOfWedding;
private Couple couple1;
private String location;
/**
*
* @param dateOfWedding
* @param couple1
* @param location
*/
public Wedding(Date dateOfWedding, Couple couple1,
String location) {
super();
this.dateOfWedding =
dateOfWedding;
this.couple1 = couple1;
this.location = location;
}
public Date getDateOfWedding() {
return dateOfWedding;
}
public Couple getCouple1() {
return couple1;
}
public String getLocation() {
return location;
}
}
/************************************WeddingDemo.java********************************/
import java.util.Date;
import java.util.Scanner;
public class WeddingDemo {
static Wedding wedding;
static Wedding wedding1;
public static void main(String[] args) {
//Calling methods
test();
display();
askUser();
}
/**
* method test
*/
public static void test() {
wedding = new Wedding(new
Date(), new Couple(new Person("Virat", "Kohli", new Date(21 / 10 /
1995)),
new Person("Anushka", "Sharma", new Date(12 / 01
/ 1994))), "Jaipur");
wedding1 = new Wedding(new Date(),
new Couple(new Person("Mahendra Singh", "Dhoni", new Date(22 / 10 /
1991)),
new Person("Shakshi", "Sharma", new Date(12 / 01
/ 1994))), "Delhi");
}
/**
* method display
*/
public static void display() {
System.out.println("Wedding of "
+ wedding.getCouple1().getPerson1().getFirstName() + " "
+
wedding.getCouple1().getPerson1().getLastName() + " And "
+
wedding.getCouple1().getPerson2().getFirstName() + " "
+
wedding.getCouple1().getPerson2().getLastName() + " " +
wedding.getDateOfWedding() + " at "
+ wedding.getLocation());
System.out.println("Wedding of " +
wedding1.getCouple1().getPerson1().getFirstName() + " "
+
wedding1.getCouple1().getPerson1().getLastName() + " And "
+
wedding1.getCouple1().getPerson2().getFirstName() + " "
+
wedding1.getCouple1().getPerson2().getLastName() + " " +
wedding1.getDateOfWedding() + " at "
+ wedding1.getLocation());
}
/**
* method askUser
*/
public static void askUser() {
Scanner scan = new
Scanner(System.in);
System.out.println("Enter the
couple details: ");
System.out.println("Enter first
name of the person1");
String person1FirstName =
scan.next();
System.out.println("Enter last name
of the person1");
String person1lastName =
scan.next();
System.out.println("Enter first
name of the person2");
String person2FirstName =
scan.next();
System.out.println("Enter last name
of the person2");
String person2lastName =
scan.next();
System.out.println("Enter the
Wedding Location: ");
String weddingLocation =
scan.next();
Wedding wedding = new
Wedding(new Date(),
new Couple(new Person(person1FirstName,
person1lastName, new Date()),
new
Person(person2FirstName, person2lastName, new Date())),
weddingLocation);
System.out.println("Wedding of " +
wedding.getCouple1().getPerson1().getFirstName() + " "
+
wedding.getCouple1().getPerson1().getLastName() + " And "
+
wedding.getCouple1().getPerson2().getFirstName() + " "
+
wedding.getCouple1().getPerson2().getLastName() + " " +
wedding.getDateOfWedding() + " at "
+ wedding.getLocation());
}
}
/***************************************output********************************/
Wedding of Virat Kohli And Anushka Sharma Tue Mar 12 08:35:11
IST 2019 at Jaipur
Wedding of Mahendra Singh Dhoni And Shakshi Sharma Tue Mar 12
08:35:11 IST 2019 at Delhi
Enter the couple details:
Enter first name of the person1
Akash
Enter last name of the person1
Saini
Enter first name of the person2
Alia
Enter last name of the person2
Bhatt
Enter the Wedding Location:
SWM
Wedding of Akash Saini And Alia Bhatt Tue Mar 12 08:35:33 IST 2019
at SWM

Thanks a lot, Please let me know if you have any problem..................
Create a class named Person that holds the following fields: two String objects for the person’s...