Question: JAVA. You have been asked to design a console - based program that can manage donations to a charity organization called Helping Hands. The program

JAVA.
You have been asked to design a console-based program that can manage donations to a charity organization called "Helping Hands". The program should be able to handle different types of donations, such as cash, check, and online donations, and also track the donor's preferred cause, which now includes a description and a goal amount. Example causes are hunger relief, education, or environmental protection.
Requirements:
Create an enumeration called Cause to represent the various charitable causes supported by the organization (e.g., hunger relief, education, environmental protection). Include a description and a goal amount for each cause.
Create an abstract class called Donation with common properties and methods shared by all types of donations.
Implement subclasses for different types of donations (CashDonation, CheckDonation, and OnlineDonation), which inherit from the Donation abstract class.
Use appropriate data structures and methods to manage and display the donation details (e.g. Arraylist).
Implement a console-based menu that allows users to input and view donation details.
Instructions/Hints:
Create an enumeration named Cause with the following options: HUNGER_RELIEF, EDUCATION, ENVIRONMENTAL_PROTECTION. Add a description and a goal amount for each cause. Override the toString() method to display the cause's description and goal amount.
Create an abstract class named Donation with the following properties:
donorName: String
amount: double
cause: Cause (use the enumeration you created in step 1)
Implement the following methods:
getDonorName(): String
getAmount(): double
getCause(): Cause
displayDonationDetails(): void
calculateProcessingFee(): double (this method will be abstract)
Create subclasses for each type of donation: CashDonation, CheckDonation, and OnlineDonation. In each subclass, implement the calculateProcessingFee() method to calculate the processing fee based on the donation type. For example:
The processing fee for cash donations can be a flat fee (e.g.50 cents).
The processing fee for check donations a percentage of the donated amount (e.g.10%).
The processing fee for online donations a combination of a fixed fee and a percentage (e.g.50 cents +10% of the amount of donation).
In each subclass, modify the displayDonationDetails() method to display the donation's specific details, including the calculated processing fee.
Design a class named DonationManager to manage and display the donation details. The class should include methods for adding and displaying donations and should use appropriate data structures to store the donations.
Create a class named Main with a console-based interface that allows users to input and view donation details. The interface should provide options for users to add and display donations of different types and support input validation to ensure data consistency.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!