Java Programming
Java Programming
9th Edition
ISBN: 9780357616635
Author: Joyce Farrell
Publisher: CENGAGE L
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
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.
Create a class named Ship that has two private fields one for the name (string)of the ship, and the other for the year (string) the ship was built. The classcontains a parameterized constructor to set the values of each field get methods for each of the fields display method to display ship’s information.Create a class named CruiseShip that extends Ship class. CruiseShip class should have a private field for the maximum number of passengers (int).The class contains- a parameterized constructor to set the value of the field- get and set method for the field- a display method that overrides ship class display method anddisplay CruiseShip information.Create an application/class named CruiseShipDemo that allows a user toenter values to create 5 CruiseShip objects and save them in the array. Display the records.The CruiseShipDemo class should have a method named update to updatethe CruiseShips information. The method prompts the user for the ship name, if the requested record does not…
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