EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Videos

Question
100%
Book Icon
Chapter 4, Problem 11PE
Program Plan Intro

Wedding details

Program plan:

Filename: “Person.java”

  • Define the “Person” class
    • Declare the member variables.
    • Define the constructor
      • Set the values.
    • Define the “getFirstName” method
      • Return the first name
    • Define the “getLastName” method
      • Return the last name
    • Define the “getBirthDate” method
      • Return the birth day

Filename: “Couple.java”

  • Define the “Couple” class
    • Declare the member variables.
    • Define the constructor
      • Set the values.
    • Define the “getFirstPerson” method
      • Return the first person name
    • Define the “getSecondPerson” method
      • Return the second person name

Filename: “Wedding.java”

  • Define the “Wedding” class
    • Declare the member variables.
    • Define the constructor
      • Set the values.
    • Define the “getWeddingDate” method
      • Return the wedding date
    • Define the “getCouple” method
      • Return the couple
    • Define the “getLocation” method
      • Return the location

Filename: “TestWedding.java”

  • Define the “TestWedding” class
    • Declare the variable for “SimpleDateFormat”.
    • Create the objects for “Person” class
    • Display the wedding details.
    • Define the main method
    • Create the objects for “Person” class
    • Create an object for “Couple” class
    • Create an object for “Wedding” class
    • Call the “displayWedding” method with an argument
    • Create the objects for “Person” class
    • Create an object for “Couple” class
    • Create an object for “Wedding” class
    • Call the “displayWedding” method with an argument.

Blurred answer
Students have asked these similar questions
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 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.
Create a class named Person that holds the following fields: two String objectsfor the person’s first and last name and a LocalDate object for the person’sbirthdate. Create a class named Couple that contains two Person objects. Create aclass 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. Provideconstructors for each class that accept parameters for each field, and provide getmethods for each field. Then write a program that creates two Wedding objectsand in turn passes each to a method that displays all the details. Save the files asPerson.java, Couple.java, Wedding.java, and TestWedding.java.
(The Rectangle class) Following the example of the Circle class in Section 8.2,design a class named Rectangle to represent a rectangle. The class contains:■ Two double data fields named width and height that specify the width andheight of the rectangle. The default values are 1 for both width and height.■ A no-arg constructor that creates a default rectangle.■ A constructor that creates a rectangle with the specified width and height.■ A method named getArea() that returns the area of this rectangle.■ A method named getPerimeter() that returns the perimeter.Draw the UML diagram for the class and then implement the class. Write a testprogram that creates two Rectangle objects—one with width 4 and height 40and the other with width 3.5 and height 35.9. Display the width, height, area,and perimeter of each rectangle in this order.
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY