1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
soldi70 [24.7K]
3 years ago
15

Hello, my first time being here and I'm returning back from college and I'm now studying Java in college but I was stuck doing t

his last part of the assignment that I was given, I have until Monday midnight to turn this in, if anyone out there can assist me please, please do. Here's the code that I have wrote at the moment:
import java.time.LocalDate;


//Test driver class


public class TestWedding {


Wedding wedding1= null;

Wedding wedding2= null;


public void testWeddingObject = LocalDate.of(2019, 11, 9);(){

wedding1 = new Wedding(dateObject, "SantaFe", "New Mexico");

wedding2 = new Wedding(dateObject, "SantaFe", "New Mexico");

displayDetails(wedding1, wedding2)

}


public void displayDetails(Wedding wedding1, Wedding wedding2){

System.out.println("\n" + David);

System.out.println("and" + Sue);

System.out.println("are inviting you to their");

System.out.println(" The Big Wedding ");

System.out.println(wedding1.getWeddingDate() + " " wedding2.getWeddingDate());

System.out.println(wedding1.getLocation() + " " wedding2.getLocation());

}

class Person{

String David;

String Sue;

LocalDate September161994;

}

}

}


Please and thank you


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.
Computers and Technology
1 answer:
KengaRu [80]3 years ago
6 0

Answer:

import java.time.LocalDate;

class TestWedding {

 public static void main(String[] args) {

   Person man1 = new Person("John", "Doe", LocalDate.parse("1990-05-23"));

   Person woman1 = new Person("Jane", "Something", LocalDate.parse("1995-07-03"));

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

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

   Couple cpl1 = new Couple(man1, woman1);

   Couple cpl2 = new Couple(man2, woman2);

   Wedding wed1 = new Wedding(cpl1, "Las Vegas", 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());

 }

}

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

class Couple {

 private Person person1;

 private Person person2;

 public Couple(Person p1, Person p2) {

   person1 = p1;

   person2 = p2;

 }

 public String toString() {

   return person1.toString() + " and " + person2.toString();

 }

}

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

import java.time.LocalDate;

import java.time.format.DateTimeFormatter;

class Person {

 private String firstName;

 private String lastName;

 private LocalDate birthDate;

 public Person(String first, String last, LocalDate bdate) {

   firstName = first;

   lastName = last;

   birthDate = bdate;

 }

 public String getFirstName() {

   return firstName;

 }

 public String toString() {

   DateTimeFormatter formatter = DateTimeFormatter.ofPattern("LLLL dd, yyyy");

   return String.format("%s %s born %s", this.firstName, this.lastName, birthDate.format(formatter));

 }

}

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

import java.time.LocalDate;

import java.time.format.DateTimeFormatter;

class Wedding {

 private Couple couple;

 private String location;

 private LocalDate weddingDate;

 public Wedding(Couple c, String loc, LocalDate wDate) {

   couple = c;

   location = loc;

   weddingDate = wDate;

 }

 public String getLocation() {

       return this.location;

 }

 public String toString() {

   DateTimeFormatter formatter = DateTimeFormatter.ofPattern("LLLL dd, yyyy");

   return  

     couple.toString() +  

     " are getting married in " + location + " on "+

     weddingDate.format(formatter);

 }

}

Explanation:

I used overrides of toString to let each object print its own details. That's why this solution doesn't really require any getters. I implemented some to show how it's done, but you'll have to complete it. The solution shows how to think in an OO way; ie., let every class take care of its own stuff.

You might be interested in
Which wireless communication is typically limited to six feet of distance?
Tcecarenko [31]

Answer:

Bluetooth is a wireless communication    is  typically limited to   six feet distances

Explanation:

Bluetooth is one type of communication maximum it covers  10 meters to 30 meters.   but it is one to one communication made for data transactions.  After  25 meters of coverage on communication will be very slow on data transactions. But Bluetooth has also had a limitation.

IR.  It is one of communication where infrared technology used. It is like face to face communication and speed of data transaction limited and it is also one to one communication made for data transactions. Communication paired and covered very little distances.

NFC it is chip-based and covers very little in fact just to device meet each and communication started. And very it caries very little data during the data transactions. it is also one to one communication made for data transactions

RFID is one of communication and it is powerful to cover more areas with multiple connections at the same time. It has a limitation  in distance and it covers  like a net with a specific distance  

4 0
3 years ago
A computer connected to the Internet that asks for data is a(n) ________. Select one: A. server B. client C. aggregator D. surro
madreJ [45]

Answer:

client

Explanation:

The client makes a request for a service, and a server performs that service.

7 0
3 years ago
Mrs. Patel uses a computer program to balance her checkbook. Which of the following best explains how the
Alexandra [31]

Answer:

c it reduces errors

Explanation:

Instead of Mrs.Patel doing it she has an online program made for checks to do it for her.

6 0
3 years ago
A grade of B is worth Grade points<br><br><br> A) 3.0<br> B) 80<br> C)2.0<br> D)4.0
Elodia [21]

Answer:

I am pretty sure. In my view answer is 4.0

8 0
3 years ago
Read 2 more answers
The REPE prefix does which of the following ?a. Repeats an instruction while the zero flag is clearb. Repeats an instruction whi
lora16 [44]

Answer:

repeats an instruction while the Zero flag is set

Explanation:

hope this helps you :)

6 0
3 years ago
Read 2 more answers
Other questions:
  • PLEASE HELP Which of the following is considered a modern method of communication?
    6·2 answers
  • In microsoft windows when a window is minimized what happens to that window
    9·1 answer
  • Approximately what percentage of the world population owns a smartphone?
    9·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • 18) choose which article title would most likely be described by the database subject headings victims of famine, ireland, histo
    14·1 answer
  • Jill is setting up a presentation and wants to use a built-in equation, such as the area of a triangle. To insert this in her pr
    14·2 answers
  • Assembly (Procedure and Conditional Processing). For the following program, what are outputs for register EAX, EBX, ECX, and EDX
    11·1 answer
  • HELP PLS TIME LIMIT HERE
    11·1 answer
  • The term embedded system refers to any device that includes a computer chip, but that is not a general-purpose workstation, desk
    5·1 answer
  • Determine which system you would recommend each of the customers use based on their provided user and system specs.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!