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
Internet is a boon or curse
tangare [24]
It really depends on what you're using it for such as looking up a recipe or an answer to a question. If you're using it for illegal purposes or looking up things that are seen as morally wrong by other people it can make the internet seem like a bad thing. But the internet wasn't created with that intended purpose so again it's just your own personal opinion.
4 0
3 years ago
Explique como são gravados (escrita) os bits zero ou um no HD.
rodikova [14]

Answer:

The following are the description of storing bits into Hard-disk.

Explanation:

As we know computer only know the binary language, that is in the form of zero's and once's "0's and 1's". In the hard drive, it requires a magnetically covered rotating disc, that's  "head" passes over its platter.

  • It marked 0's and 1's on the platter as tiny electronic areas in the north.
  • Its head goes to the very same location to read its information again, the north and south places pass there and assume from the 0s and 1s which are contained.

8 0
3 years ago
A soft drink company recently surveyed 12,467 of its customers and found that approximately 14 percent of those surveyed purchas
Mnenie [13.5K]

Given Information:

Total number of customers = 12,467

Customers who purchase one or more energy drinks per week = 14%

Customers who prefer citrus flavored energy drinks = 64% of customers who purchase one or more energy drinks per week

Required Information:

1. the approximate number of customers in the survey who purchase one or more energy drinks per week

2. the approximate number of customers in the survey who prefer citrus flavored energy drinks

Code with Explanation:

#include <iostream>

using namespace std;

int main()

{

   int customers = 12467;  // total no. of customers given

   int buy_drink;  // to store the number of customers who buy one or more energy drinks per week

   int citrus_drink;  // to store the number of customers who prefer citrus flavored energy drinks

 

   buy_drink = customers*0.14;  // multiply total number of customers with the % of customers who buy energy drinks

   citrus_drink = buy_drink*0.64;  // multiply no. of customers who buy one or more energy drinks per week with % of customers who prefer citrus flavor

// display the results calculated above

   cout<<"Total number of customers: "<<customers<<endl;

   cout<<"Number of customers who buy one or more drinks per week: "<<buy_drink<<endl;

   cout<<"Number of customers who prefer citrus flavored drinks per week: "<<citrus_drink<<endl;

   return 0;

}

Output:

Total number of customers: 12467

Number of customers who buy one or more drinks per week: 1745

Number of customers who prefer citrus flavored drinks per week: 1116

7 0
3 years ago
What is the final amount stored in value if the computer selects 17 as the
nadya68 [22]

Answer: -17

Explanation:

Our random number is 17. Let's go through line by line.

  1. value is a random number picked which is 17
  2. valueB = 17 / 2 = 8.5
  3. If value is greater than 0 AND value has a remainder of 1, we will set the value to value* -1.
  4. Value is now 17 * -1 = -17

Let's quickly calculate value mod 2. 17 % 2 = is 1. If you're wondering how we did that, the remainder after dividing 8 into 17 twice is 1, because 17 - 16 = 1.

We stop after line 4 because we stop the conditional statement after one condition is filled.

6 0
3 years ago
WILL GIVE 100 POINTS AND GIVE BRAINIEST TO THE FIRST PEOPLE THAT ANSWER CORRECTLY!!!!!! Marcus wants to create a spreadsheet wit
maks197457 [2]

Answer:

tell me bar

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Whats the difference between search engine and web browser?
    6·2 answers
  • How to get this on your screen in 2k20 on Xbox
    14·2 answers
  • Moving laterally within a network once an initial exploit is used to gain persistent access for the purpose of establishing furt
    10·1 answer
  • Explain about forensic tools?
    14·1 answer
  • Difference between ancient and modern mode of information <br> transmission
    12·1 answer
  • Pat is listing the parts of a computer. Which is the best option to use when formatting the list?
    12·1 answer
  • in python, using the simplest form the print_seconds function so that it prints the total amount of seconds given the hours, min
    10·1 answer
  • NEED HELP FAST timed
    13·1 answer
  • In which situation is coauthoring of presentations primarily utilized?
    9·1 answer
  • Pleaseeeeeeee tellllllllllllllllllllll​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!