Question: Need help in Java --- TreePlanter: You have been asked by TeamTrees to help them keep track of donations to their restoration efforts.They are receiving

Need help in Java ---

TreePlanter:

You have been asked by TeamTrees to help them keep track of donations to their restoration efforts.They are receiving raw donar data from their donation site , and they have asked you to write a program to pull out useful information to export their website to show off their receipts and attract more donars.

Classes: Create a total of three classes for this project and use the exact names specified here:

Donation - Donation represents a single donation. Private data members hold the information for a donation : data,amount and donar name.See the input section for details on what these look like.Methods to write: - Default constructor , no parameters - Constructor that takes three parameters and initializes all data members - Getter and setter methods for each of the data members.

Donar List: Represents the list of all donations as contained in the input file.Primary data member is an ArrayList of Donation objects.Methods include: - Default constructor, no parameters - readDonations : takes a Scanner parameter and reads all the information from the associated file , one line at a time.Creates a Donation Object for each line read, and adds it to its private ArrayList. Returns the number of donations read. - monthDonations: takes three parameters - a PrintWriter Object , a year, and a month (in that order).It prints to the PrintWriter every donation whose year and month match the request from the parameters. -bigDonars : takes a PrintWriter object., and a threshhold number.It prints to the PrintWriter every donation at or above the amount specified by the input parameter. Donar Reports: This is the class with the main method.It creates one DonarList Object.It will do these actions.:Creates a scanner and opens the input file.Makes Calls to the three methods of DonarList to (1) read in the data (2)create an Output file "monthly.txt" and calls the DonarList monthDurations to write the file with all donations in February 2021. (3)Create an output file "over500.txt" and call bigDonars to output all donations >= 500.

Files:

Your program will read the donar data from a file named donardata.txt Input: Each line of the input file will contain three items: 1. Date -- a single number in the form of YYMMDD 2. Trees -- number of trees donated 3.Name --- remainder of the line is the donar name. It could be one or more words.

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!