EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Videos

Question
100%
Book Icon
Chapter 4, Problem 12PE
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.
Design a Ship class that the following members: A field for the name of the ship (a string). A field for the year that the ship was built (a string). A constructor and appropriate accessors and mutators. A toString method that displays the ship’s name and the year it was built. Design a CruiseShip class that extends the Ship class. The CruiseShip class should have the following members: A field for the maximum number of passengers (an int). A constructor and appropriate accessors and mutators. A toString method that overrides the toString method in the base class. The CruiseShip class’s toString method should display only the ship’s name and the maximum number of passengers. Design a CargoShip class that extends the Ship class. The CargoShip class should have the following members: A field for the cargo capacity in tonnage (an int). A constructor and appropriate accessors and mutators. A toString method that overrides the toString method in the base class. The…
Design a Book class that holds the title, author’s name, and price of the book. Books’s constructor should initialize all of these data members except the price which is set to 500/-. Create a display method that displays all fields. All Books are priced at 500/- unless they are PopularBooks. The PopularBooks subclass replaces the Bookprice and sets each Book’s price to 50,000/- through PopularBooks construcor. Override the display method to display all fields. Write a Main () method that declares an array of five Book objects. Ask the user to enter the title and author for each of the 5 Books. Consider the Book to be a PopularBook if the author is one of the following: Khaled Hosseini, Oscar Wilde, or Rembrandt. Display the five Books’ details.
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
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