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 consolebased 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 eg 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 eg Arraylist
Implement a consolebased menu that allows users to input and view donation details.
InstructionsHints:
Create an enumeration named Cause with the following options: HUNGERRELIEF, EDUCATION, ENVIRONMENTALPROTECTION. 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
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 eg cents
The processing fee for check donations a percentage of the donated amount eg
The processing fee for online donations a combination of a fixed fee and a percentage eg cents 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 consolebased 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
