Donation Drive
Write a program that tracks a school's holiday donations by classroom. There are 15 classrooms participating in the donation drive. Each classroom is numbered 1 to 15.
Logging Donations
Use a for loop to prompt each classroom for their donations. Keep track of the following:
- Total donations collected;
- Number of classrooms donating 25 or more items; and
- Classroom number with the largest donation.
Provide Classroom Recognition
After each classroom donation, report their recognition level based on the following:
- 50 or more: Holiday Hero
- 25 to 49: Community Helper
- less than 25: Thanks for Helping
Final Report
Once all classroom donations have been collected, report the following:
- total donations collected;
- average number of items per classroom (as a whole number rounding down);
- classroom most donations;
- whether the school has reached their target number of donations, which is 500 donated items.
Determine Test Cases
Develop test cases to represent each classroom's donations. Include different donation amounts to report the different levels of recognition.
Edge Cases
When testing, you will want to provide values that all the situations, including the different classroom recognitions, whether or not the school met their goal, average number of items that naturally round up or down, and if two classrooms have the highest number of donations.
Algorithm
Write your algorithm for this program. Include the input, output,and conditions that will be needed. Will you need a loop? Will you need any if statements?
Trace Your Algorithm
Use your test data to trace through your algorithms and make necessary adjustments.
Write Your Program in an IDE
Now that you have planned out your program, it's time to write it in your IDE. Since this program requires input values, use of the Java Playground is not an option.
Create a DonationCenter.java file for your main program file. Add your algorithm to the body of the main method in the starter code provided.