A simple, modular Java project demonstrating Object-Oriented Programming (OOP) concepts including encapsulation, abstraction, and collection management.
schmss/
├── src/
│ ├── Event.java # Event class
│ ├── Donor.java # Donor class
│ ├── Pledge.java # Pledge/Donation class
│ ├── FundraisingSystem.java # Manager class (Business Logic)
│ └── Main.java # Menu-driven interface
├── bin/ # Compiled .class files
├── README.md # This file
└── compile.bat # Batch script for Windows compilation
Represents a charity event with the following properties:
eventId: Unique identifier (auto-generated)eventName: Name of the eventtargetAmount: Fundraising goaldescription: Event descriptioncollectedAmount: Total funds collected
Key Methods:
addFunds(): Add donations to the eventgetProgressPercentage(): Calculate progress towards targetdisplayEventDetails(): Show event information
Represents a person who can donate to events:
donorId: Unique identifier (auto-generated)donorName: Name of donoremail: Email addressphoneNumber: Phone number
Key Methods:
- Getters and Setters for all properties
displayDonorDetails(): Show donor information
Represents a donation/pledge from a donor to an event:
pledgeId: Unique identifier (auto-generated)donorId: Reference to donoreventId: Reference to eventpledgeAmount: Donation amountpledgeDate: Date of donation
Key Methods:
- Getters and Setters for all properties
displayPledgeDetails(): Show pledge information
Central manager class that handles all business logic:
Collections Used:
ArrayList<Event>- Store all eventsArrayList<Donor>- Store all donorsArrayList<Pledge>- Store all pledges
Key Methods:
- Event Management:
addEvent(),getEventById(),displayAllEvents() - Donor Management:
addDonor(),getDonorById(),displayAllDonors() - Pledge Management:
makePledge(),getPledgesForEvent(),displayDonorsForEvent() - Validation: Input validation for all operations
Provides a user-friendly, menu-driven interface:
Menu Options:
- Create New Event
- Register Donor
- Make Donation to Event
- View All Events
- View Donors of Specific Event
- View All Donors
- View Statistics
- Exit
✅ Encapsulation
- Private fields with public getters/setters
- Data hiding and controlled access
✅ Abstraction
- Complex logic hidden in FundraisingSystem
- User interacts through simple Main interface
✅ Modularity
- Each class has single responsibility
- Classes are independent and reusable
✅ Collections
- ArrayList for dynamic storage
- Flexible size management
✅ Validation
- Input validation (positive amounts)
- Existence checking (donor/event)
- User-friendly error messages
1. Navigate to the project folder: cd c:\Users\Dipak\Desktop\OOAD\schmss
2. Run: compile.bat
3. The program will compile and run automatically
# Navigate to project directory
cd c:\Users\Dipak\Desktop\OOAD\schmss
# Compile all Java files
javac -d bin src/*.java
# Run the program
java -cp bin Main# Navigate to project directory
cd c:\Users\Dipak\Desktop\OOAD\schmss
# Compile all Java files
javac -d bin src\*.java
# Run the program
java -cp bin MainEnter: 1 (Create New Event)
Event Name: AIDS Awareness 2026
Target Amount: 50000
Description: Fundraiser for AIDS awareness and prevention
Result: Event EVT1 created
Enter: 2 (Register Donor)
Donor Name: Raj Kumar
Email: raj@email.com
Phone: 9876543210
Result: Donor DOR1 registered
Enter: 3 (Make Donation)
Donor ID: DOR1
Event ID: EVT1
Amount: 5000
Result: Donation recorded, Pledge ID: PLD1
Enter: 4 (View All Events)
Shows all events with:
- Event name and ID
- Target and collected amounts
- Progress percentage
- Remaining amount needed
Enter: 5 (View Donors for Event)
Event ID: EVT1
Shows all donors who contributed to the event
✅ Create Events: Define fundraising goals and descriptions ✅ Register Donors: Manage donor information ✅ Make Donations: Track pledges with automatic date recording ✅ Track Progress: Real-time calculation of achievement percentage ✅ View Reports: Multiple views of events, donors, and pledges ✅ Validation: Prevents invalid data entry ✅ In-Memory Storage: No database required ✅ User-Friendly Interface: Menu-driven CLI
- Language: Java 8+
- Data Structures: ArrayList
- Date Format: YYYY-MM-DD (auto-generated)
- ID Format:
- Events: EVT1, EVT2, EVT3...
- Donors: DOR1, DOR2, DOR3...
- Pledges: PLD1, PLD2, PLD3...
| Validation | Rule |
|---|---|
| Event Name | Cannot be empty |
| Target Amount | Must be positive |
| Donor Name | Cannot be empty |
| Donation Amount | Must be positive |
| Donor/Event Check | Must exist in system |
This project can be extended with:
- File I/O for data persistence
- Database integration
- Web UI using Spring Boot
- Advanced reporting features
- Email notifications
- Export to PDF/Excel
This project demonstrates:
- How to design classes with responsibilities
- Proper use of encapsulation and access modifiers
- Managing collections with ArrayList
- Input validation and error handling
- Menu-driven console application design
- Real-world business logic modeling
- All IDs are auto-generated
- Progress percentage is calculated in real-time
- Donations are recorded with the current date
- No external dependencies required
- Beginner-friendly code with comments