Question

Scenario: You have decided to start your own donation tracking system, to compete with GoFundMe.
Your system will manage donations for charitable and non-charitable campaigns.
Campaigns are allowed to solicit donations up to a goal amount of $25,000.
The goal amount can be entered when the campaign is created, but if it is not included, the goal amount will default to $10,000.
Donations made to non-profit campaigns do not incur an administrative fee, while each donation made to for-profit campaigns incur a 5% administrative fee off the donation amount.
For example, a $100 donation would immediately incur a 5% administrative fee and be recorded as a $95 donation.
Create an application that uses solid object-oriented principles to create two campaigns and processes donations for each campaign.
The data definition class (DDC) must also store the campaign name and if the campaign is a for-profit or non-profit campaign.
The DDC must have validating mutators for all numeric instance variables and non-validating mutators for non-numeric instance variables.
Accessors must be created for all instance variables.
The implementation class will instantiate two instances of the data definition class.
The first campaign will be a pre-defined campaign.
The campaign is a non-profit campaign for an IT Student Scholarship Fund with a goal amount of $15,000 and donations in the amount of $2,000, $3,600, and $1,255.
Your implementation class should hardcode the creation of this campaign in the code. (Note: Do not use user input to create the first campaign)
The second campaign will come from user input.
The application must prompt the user for the campaign name, if the campaign is a for-profit or non-profit campaign, and if the default goal amount will be used.
If the default goal amount will not be used, the user must be prompted to enter the goal amount.
Then, the user must be prompted to enter donation amounts, one at a time, until the goal amount is reached or no more donations are available, whichever comes first.
After entering data for the second campaign, print a well-formatted report containing a report header.
In the report, for each campaign, list the campaign name, total amount of donations collected, and goal amount.
If the goal amount was not reached, print the amount under the goal amount that was collected.
If the goal amount was reached, print the amount over the goal amount that was reached.
If the goal amount was exactly reached, do not print any under/over amount.
Lastly, denote the name of the campaign that collected a higher amount of donations.
If both campaigns collected the same amount, include a message in the report stating both campaigns collected the same amount.
Notes:
• Do not use arrays in your solution. Arrays are not necessary.
• There are a number of validations that must occur.
As one example, think about what type of validation might be appropriate when gathering an item amount.
Make sure these are all handled.
Whenever an invalid value is entered, the user must be informed that an error has occurred and then be re-prompted to enter in a new value.
• Think about any special purpose methods that might be needed in the data definition class.
Special purpose methods are important when using values in instance variables to perform a specific process.
• Think about how constructors might be used when creating your data definition class.
Other Requirements:
• Your solution must use object-oriented techniques. No points will be awarded for a procedural solution.
• Your implementation class must contain several modules/methods other than main.
Each module/method should do only one thing.
• You may not use Scanner or System classes for input/output. You must use JOptionPane.
• You may not use System.exit, or any variant that exits the program in the middle of the program.
The program should only exit once the algorithm has finished completing.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.awt.HeadlessException;
import java.text.NumberFormat;
import java.util.Locale;
import javax.swing.JFrame;
import javax.swing.JOptionPane;



/**
*
* @author
*/
public class Driver {
    public static void main(String[] args) {
      
       // Create an application that uses solid object-oriented principles to
       // create two campaigns and processes donations for each campaign.
      
       // The first campaign will be a pre-defined campaign.
       // The campaign is a non-profit campaign for an IT Student Scholarship Fund
       // with a goal amount of $15,000 and donations in the amount of $2,000, $3,600,
       // and $1,255.
       Campaign predefinedCampaign = new Campaign("IT Student Scholarship Fund",
                                                    Campaign.NON_PROFIT, 15000);
       predefinedCampaign.addDonation(2000);
       predefinedCampaign.addDonation(3600);
       predefinedCampaign.addDonation(1255);...

This is only a preview of the solution. Please use the purchase button to see the entire solution

$30.00

or free if you
register a new account!

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats