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 birthdate. 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 names of the Couple being married, and a String for the location. Provide constructors for each class that accept parameters for each field, and provide get methods for each field. Then write a program that creates two Wedding objects and in turn passes each to a method that displays all the details. Save the files as Person.java, Couple.java, Wedding.java, and TestWedding.java.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello, my first time being here I actually stuck on this assignment that was given from last week. I'm currently working on the last piece of this assignment I would greatly appreicate to any solutions. Here's the question:

 

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
birthdate.
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 names of the Couple being married, and a String for the location.
Provide constructors for each class that accept parameters for each field, and provide
get methods for each field.
Then write a program that creates two Wedding objects and in turn passes each to a method that displays all the details.
Save the files as Person.java, Couple.java, Wedding.java, and TestWedding.java.

 

Here's what I have so far:

 

//Person Class

 

import java.time.LocalDate;

public class Person {

String David;
String Gonzalez;
LocalDate September161994;

{
System.out.println(" First Name " + David);
System.out.println(" Last Name " + Gonzalez);
}
public static void main(String[] args)
{

}

}

 

-------------------

 

// Couple Class

public class Couple {

String David;
String Sue;
{
System.out.println(" His name is " + David);
System.out.println(" Her name is " + Sue);
}
public static void main(String[] args)
{
}
}

 

---------------------

// Wedding Class

 

import java.time.LocalDate;
//Wedding class

public class Wedding {

private static LocalDate weddingDate;

//Member variables

private String c;

private String location;

private LocalDate date;
{
}
//These will Paramterized constructors that initializes all the member variables

public Wedding(LocalDate day, String couple, String wedLocation)
{

date = day;

c = couple;

location = wedLocation;

}

//Getter methods for each of the member variables

public LocalDate getWeddingDate() {

return date;

}

public String getCouple() {

return c;

}

public String getLocation() {

return location;

}
public static void main(String[] args)
{
LocalDate dateObject = LocalDate.of(2019, 11, 9);
Wedding wedding = new Wedding(dateObject, "SantaFe", "New Mexico");
String wedLocation = "Test";
wedLocation = wedding.getLocation();
System.out.println("The Wedding will be held at " + wedLocation);
}
}

 

---------------------

 

//TestWedding Class

 

import java.time.LocalDate;

public class Main
{

public static void main(String[] args) {

Person man1 = new Person("David", "Gonzalez", LocalDate.parse("1994-09-16"));

Person woman1 = new Person("Sue", "Ling", LocalDate.parse("1996-05-12"));

Person man2 = new Person("David", "Johnson", LocalDate.parse("1991-04-13"));

Person woman2 = new Person("Daisy", "Smith", LocalDate.parse("1997-12-01"));

Couple cpl1 = new Couple(man1, woman1);

Couple cpl2 = new Couple(man2, woman2);

Wedding wed1 = new Wedding(cpl1, "New Mexico", LocalDate.parse("2020-09-12"));

Wedding wed2 = new Wedding(cpl2, "Hawaii", LocalDate.parse("2021-01-02"));

displayDetails(wed1, wed2);

}

public static void displayDetails(Wedding w1, Wedding w2) {

System.out.println(w1.toString());

System.out.println(w2.toString());

}
}

 

I will leave my further email contact in case I don't get a notification here. starrich55@gmail.com

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 1 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education