ABC Company is a Courier Company based in the Philippines. Whenever a package is sent it needs of sender and receiver. Define a class Parcel with the following attributes ender and receiver of type Person. Do the following: Encapsulate the fields PROVIDE default constructor, constructor that accepts the attributes and a constructor that

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 13SA
icon
Related questions
Question

SEE ATTACHED PHOTO

Java Program
ABC Company is a Courier Company based in the Philippines. Whenever a package is sent it needs information
of sender and receiver. Define a class Parcel with the following attributes
sender and receiver of type Person.
Do the following:
- Encapsulate the fields
- PROVIDE default constructor, constructor that accepts the attributes and a constructor that accepts 2
names, 2 addresses, and 2 cellular phone numbers
- Override equals and toString of the Object class
- Define method computeFee with a return type of double. Method computeFee has different implementation
in each subclass.
Note:
Person has the following attributes: String name, String address and String phone number
Transcribed Image Text:Java Program ABC Company is a Courier Company based in the Philippines. Whenever a package is sent it needs information of sender and receiver. Define a class Parcel with the following attributes sender and receiver of type Person. Do the following: - Encapsulate the fields - PROVIDE default constructor, constructor that accepts the attributes and a constructor that accepts 2 names, 2 addresses, and 2 cellular phone numbers - Override equals and toString of the Object class - Define method computeFee with a return type of double. Method computeFee has different implementation in each subclass. Note: Person has the following attributes: String name, String address and String phone number
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Class
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning