Office Depo

Ratings: 1 Star2 Stars3 Stars4 Stars5 Stars (5.00 out of 5) - Rate Now!

Download Category:

Office Depo, an office supply retailing company, donates its surpluses to colleges at the end of each year. Volunteers will help deliver packages of supplies to representatives of colleges (Recipient of supplies). Write an application to simulate delivering packages from the container of packages by the volunteers to recipients.
Concepts tested:
Generic Queue
Generic Stack
Exception handling
Data Elements
Volunteer- Holds the relevant information for a Volunteer: name
DonationPackage- Holds the information of the package to be donated: description, weight
Recipient- Holds the information of the recipients: name

Data Structures
1. Create a generic queue class called MyQueue that implements the QueueInterface given you.
2. Create a generic stack class called MyStack that implements the Stack Interface given you.
3. Create a class VolunteerLine that implements VolunteerLineInterface.
This class contains a queue of Volunteers and simulates queuing and dequeuing volunteers to and from the volunteers’ line.
4. Create a class RecipientLine that implements RecipientLineInterface .
This class contains a queue of Recipients and simulates queuing and dequeuing Recipients to and from the recipients’ line.
5. Create a class Container that implements ContainerInterface.
This class contains a stack of DonationPackage and simulates adding and removing package from the container’s stack.

– When a volunteer enters a queue they will stay in the queue and every time that the volunteer is removed from the line they will be go back to the end of the line.
– When a recipient receives a donation package they will leave their queue.

Data Manager
The DonationManager class will manage adding a new package to the container, a new volunteer to the volunteer queue line, a new recipient to the recipient queue and donating package by the volunteer to the recipient. DonationManager will implement the interface DonationManager Interface.
Exception Classes
1. RecipientException:
public class RecipientException extends RuntimeException {

public RecipientException(){};

RecipientException(String message) {

If the user attempts to add new Recipient and the recipient line is full, throw RecipientException(“Recipient Queue is full”). If user attempts to remove a recipient and the recipient is empty, throw RecipientException(“Recipient Queue is empty”);
2. VolunteerException – similar to RecipientException except throws VolunteerException when the Volunteer Queue is full or empty
3. ContainerException – similar to RecipientException except throws ContainerException when the Volunteer Stack is full or empty

You may add additional methods and attributes to your classes.
GUI Driver – provided for you

1. Initially there is no package on the container stack, or any volunteers or recipients on the queue.
2. Allows the user to load new packages to the container and add new volunteers to volunteer’s line and new recipient to recipients’ line.
3. Allows the user to simulate the process of donating a package from the container by the volunteer on the front of the Volunteer queue to the recipient on the front of the Recipient queue. When a volunteer finishes donating the package to the recipient, he/she will be placed at the back of the queue of volunteers to continue the process of donation. Each volunteer takes one package at a time to deliver to the recipient.

Get a fresh solution of this question. Ask it now to our experts.

Ask Your Question

We have verified professionals who are ready to answer your question.


Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.


Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.