Project 2 | Office Retail
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).
Create a Java application that will simulate the delivering packages from the container of packages by the volunteers to recipients.
Data Element
· Volunteer
o Holds the relevant information for a Volunteer: name
· DonationPackage
o Holds the information of the package to be donated: description, weight
· Recipient
o Holds the information of the recipients: name
Data Structure
· Create a generic queue class called MyQueue that implements the QueueInterface given to you
· Create a generic stack class called MyStack that implements the Stack Interface given to you
· Create a class VolunteerLine that implements VolunteerLineInterface
o This class contains a queue of Volunteers and simulates queuing and dequeuing volunteers to and from the volunteers’ line
· Create a class RecipientLine that implements RecipientLineInterface
o This class contains a queue of Recipients and simulates queuing and dequeuing Recipients to and from the recipients’ line
· Create a class Container that implements ContainerInterface
o This class contains a stack of DonationPackage and simulates adding and removing package from the container’s stack
· Assumptions
o 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
o 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. The three methods named managerArrayPackage, managerArrayRecipient, and managerArrayVolunteer place their data elements in an array. They all call the methods in the container, volunteer line, and recipient line respectively, named toArrayPackage, toArrayVolunteer, and toArrayRecipient. Each of those methods calls toArray in MyStack or MyQueue.
o Notice that because of type erasure in the generic MyStack and MyQueue, if their toArray methods return an array of type T, i.e., T[], they are actually returning Object[]. But since the individual elements of the array are still Packages, Recipients, or Volunteers, we can copy them one by one into a new array of the appropriate type and cast each one to the appropriate type.
· DonationManager will implement the interface DonationManager Interface
Exception Classes
· RecipientException:
public class RecipientException extends RuntimeException {
public RecipientException(){};
RecipientException(String message) {
super(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”);
· VolunteerException – similar to RecipientException except throws VolunteerException when the Volunteer Queue is full or empty
· 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, however, they cannot impact (or interfere with) any of the provided public test cases
The GUI (Provided for You)
· Initially there is no package on the container stack, or any volunteers or recipients on the queue
· Allows the user to load new packages to the container and add new volunteers to volunteer’s line and new recipient to recipients’ line
· 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
Programming Concepts
This project utilizes the following concepts:
· Previously learned materials
· Generic Queue
· Generic Stack
· Exception handling
·
GitHub
· As you are working on your project, utilize your GitHub repro to manage your work. You will need to submit a screenshot of your repro.
Testing
As a typical user, I should be able to utilize your program without running into too much difficulties! Thoroughly test your project
· Think about the public and private test cases which your instructor will test your project against
Write-up & Submission Requirements
Review the provided rubric to understand project expectations, including documentation, CMSC204, and programming requirements. Two artifacts MUST be submitted for this project: Java source code and a write-up.
At a minimum, the write-up needs to address -
Approach, design & algorithm
DO NOT start coding your project immediately! Come up with a high level design for the project first
What’s your game plan to complete the project?
Break the project into smallest modules where applicable
UML diagrams will go a long way
Each student is welcome to expand on the design, if it makes sense. Students will not be penalized for going “above and beyond” specifications of the project
Complete this step first, then write your code
Test Plan & Test Cases
Ensure that your project can successfully pass all provided “public test cases.” What other test cases have you attempted?
Students should think about potential private tests – what would they be?
Your instructor will test your project using an additional set of private test cases as well as the provided public test cases
o I want to see your “thinking,” in particular, how you are testing your program
o Each submission should be rock solid, with no bugs
Capture screenshots of your test runs in your write-up as you run them
Highlight your learning experience and lessons learned
I am very interested to learn about what you have done, how you did, etc.
Anything else that you want to share with me
· Take a screen shot of the repo with the directory and files
If your project is not working as expected, submit it as-is but clearly articulate your situation in your write-up in order to potentially receive partial credit
Each student must submit one compressed (.zip) file back to the Assignment (link) with the following deliverables:
Your entire Eclipse project folder (Source code included)
Write-up as a Word or PDF file, one write-up per project
· I WILL compile, run and test every submission using a set of public and private test cases – this is how I test to ensure that your project is working correctly
· Name the compressed file (zip format) as <lastname_project_x
where x is the project number and your last name (e.g. Thai_Project_1.zip)
Double check your submission, as I can only grade what’s being submitted (don’t assume anything)
DO NOT email your submission! It won’t be accepted
Not clear? That’s okay, but do ask your questions. “I did not know” or “I did not understand” is not good enough.
Start working on each project immediately so that we can discuss any concerns or questions you have. Reminder – I am unavailable on Saturdays and have limited availability on Sundays.
Sample Test Cases & Outputs from Previous Semester (Don’t expect your project to be identical to these)
At startup
After selecting “Stack New Package” Pen(first) and Books (second).
After adding new Volunteers John (first), Nicole (second)
After adding new Recipients MC (first), Maryland (second)
After selecting Donate Package First Time
After selecting Donate Package Second time
After selecting Donate Package Third time
If the user tries to add a new volunteer and the line of volunteers is full:
Project 2 | Office Retail
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).
Create a Java application that will simulate the delivering packages from the container of packages by the volunteers to recipients.
Data Element
· Volunteer
o Holds the relevant information for a Volunteer: name
· DonationPackage
o Holds the information of the package to be donated: description, weight
· Recipient
o Holds the information of the recipients: name
Data Structure
· Create a generic queue class called MyQueue that implements the QueueInterface given to you
· Create a generic stack class called MyStack that implements the Stack Interface given to you
· Create a class VolunteerLine that implements VolunteerLineInterface
o This class contains a queue of Volunteers and simulates queuing and dequeuing volunteers to and from the volunteers’ line
· Create a class RecipientLine that implements RecipientLineInterface
o This class contains a queue of Recipients and simulates queuing and dequeuing Recipients to and from the recipients’ line
· Create a class Container that implements ContainerInterface
o This class contains a stack of DonationPackage and simulates adding and removing package from the container’s stack
· Assumptions
o 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
o 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. The three methods named managerArrayPackage, managerArrayRecipient, and managerArrayVolunteer place their data elements in an array. They all call the methods in the container, volunteer line, and recipient line respectively, named toArrayPackage, toArrayVolunteer, and toArrayRecipient. Each of those methods calls toArray in MyStack or MyQueue.
o Notice that because of type erasure in the generic MyStack and MyQueue, if their toArray methods return an array of type T, i.e., T[], they are actually returning Object[]. But since the individual elements of the array are still Packages, Recipients, or Volunteers, we can copy them one by one into a new array of the appropriate type and cast each one to the appropriate type.
· DonationManager will implement the interface DonationManager Interface
Exception Classes
· RecipientException:
public class RecipientException extends RuntimeException {
public RecipientException(){};
RecipientException(String message) {
super(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”);
· VolunteerException – similar to RecipientException except throws VolunteerException when the Volunteer Queue is full or empty
· 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, however, they cannot impact (or interfere with) any of the provided public test cases
The GUI (Provided for You)
· Initially there is no package on the container stack, or any volunteers or recipients on the queue
· Allows the user to load new packages to the container and add new volunteers to volunteer’s line and new recipient to recipients’ line
· 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
Programming Concepts
This project utilizes the following concepts:
· Previously learned materials
· Generic Queue
· Generic Stack
· Exception handling
·
GitHub
· As you are working on your project, utilize your GitHub repro to manage your work. You will need to submit a screenshot of your repro.
Testing
As a typical user, I should be able to utilize your program without running into too much difficulties! Thoroughly test your project
· Think about the public and private test cases which your instructor will test your project against
Write-up & Submission Requirements
Review the provided rubric to understand project expectations, including documentation, CMSC204, and programming requirements. Two artifacts MUST be submitted for this project: Java source code and a write-up.
At a minimum, the write-up needs to address -
Approach, design & algorithm
DO NOT start coding your project immediately! Come up with a high level design for the project first
What’s your game plan to complete the project?
Break the project into smallest modules where applicable
UML diagrams will go a long way
Each student is welcome to expand on the design, if it makes sense. Students will not be penalized for going “above and beyond” specifications of the project
Complete this step first, then write your code
Test Plan & Test Cases
Ensure that your project can successfully pass all provided “public test cases.” What other test cases have you attempted?
Students should think about potential private tests – what would they be?
Your instructor will test your project using an additional set of private test cases as well as the provided public test cases
o I want to see your “thinking,” in particular, how you are testing your program
o Each submission should be rock solid, with no bugs
Capture screenshots of your test runs in your write-up as you run them
Highlight your learning experience and lessons learned
I am very interested to learn about what you have done, how you did, etc.
Anything else that you want to share with me
· Take a screen shot of the repo with the directory and files
If your project is not working as expected, submit it as-is but clearly articulate your situation in your write-up in order to potentially receive partial credit
Each student must submit one compressed (.zip) file back to the Assignment (link) with the following deliverables:
Your entire Eclipse project folder (Source code included)
Write-up as a Word or PDF file, one write-up per project
· I WILL compile, run and test every submission using a set of public and private test cases – this is how I test to ensure that your project is working correctly
· Name the compressed file (zip format) as <lastname_project_x
where x is the project number and your last name (e.g. Thai_Project_1.zip)
Double check your submission, as I can only grade what’s being submitted (don’t assume anything)
DO NOT email your submission! It won’t be accepted
Not clear? That’s okay, but do ask your questions. “I did not know” or “I did not understand” is not good enough.
Start working on each project immediately so that we can discuss any concerns or questions you have. Reminder – I am unavailable on Saturdays and have limited availability on Sundays.
Sample Test Cases & Outputs from Previous Semester (Don’t expect your project to be identical to these)
At startup
After selecting “Stack New Package” Pen(first) and Books (second).
After adding new Volunteers John (first), Nicole (second)
After adding new Recipients MC (first), Maryland (second)
After selecting Donate Package First Time
After selecting Donate Package Second time
After selecting Donate Package Third time
If the user tries to add a new volunteer and the line of volunteers is full:
Project 2 | Office Retail
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).
Create a Java application that will simulate the delivering packages from the container of packages by the volunteers to recipients.
Data Element
· Volunteer
o Holds the relevant information for a Volunteer: name
· DonationPackage
o Holds the information of the package to be donated: description, weight
· Recipient
o Holds the information of the recipients: name
Data Structure
· Create a generic queue class called MyQueue that implements the QueueInterface given to you
· Create a generic stack class called MyStack that implements the Stack Interface given to you
· Create a class VolunteerLine that implements VolunteerLineInterface
o This class contains a queue of Volunteers and simulates queuing and dequeuing volunteers to and from the volunteers’ line
· Create a class RecipientLine that implements RecipientLineInterface
o This class contains a queue of Recipients and simulates queuing and dequeuing Recipients to and from the recipients’ line
· Create a class Container that implements ContainerInterface
o This class contains a stack of DonationPackage and simulates adding and removing package from the container’s stack
· Assumptions
o 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
o 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. The three methods named managerArrayPackage, managerArrayRecipient, and managerArrayVolunteer place their data elements in an array. They all call the methods in the container, volunteer line, and recipient line respectively, named toArrayPackage, toArrayVolunteer, and toArrayRecipient. Each of those methods calls toArray in MyStack or MyQueue.
o Notice that because of type erasure in the generic MyStack and MyQueue, if their toArray methods return an array of type T, i.e., T[], they are actually returning Object[]. But since the individual elements of the array are still Packages, Recipients, or Volunteers, we can copy them one by one into a new array of the appropriate type and cast each one to the appropriate type.
· DonationManager will implement the interface DonationManager Interface
Exception Classes
· RecipientException:
public class RecipientException extends RuntimeException {
public RecipientException(){};
RecipientException(String message) {
super(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”);
· VolunteerException – similar to RecipientException except throws VolunteerException when the Volunteer Queue is full or empty
· 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, however, they cannot impact (or interfere with) any of the provided public test cases
The GUI (Provided for You)
· Initially there is no package on the container stack, or any volunteers or recipients on the queue
· Allows the user to load new packages to the container and add new volunteers to volunteer’s line and new recipient to recipients’ line
· 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
Programming Concepts
This project utilizes the following concepts:
· Previously learned materials
· Generic Queue
· Generic Stack
· Exception handling
·
GitHub
· As you are working on your project, utilize your GitHub repro to manage your work. You will need to submit a screenshot of your repro.
Testing
As a typical user, I should be able to utilize your program without running into too much difficulties! Thoroughly test your project
· Think about the public and private test cases which your instructor will test your project against
Write-up & Submission Requirements
Review the provided rubric to understand project expectations, including documentation, CMSC204, and programming requirements. Two artifacts MUST be submitted for this project: Java source code and a write-up.
At a minimum, the write-up needs to address -
Approach, design & algorithm
DO NOT start coding your project immediately! Come up with a high level design for the project first
What’s your game plan to complete the project?
Break the project into smallest modules where applicable
UML diagrams will go a long way
Each student is welcome to expand on the design, if it makes sense. Students will not be penalized for going “above and beyond” specifications of the project
Complete this step first, then write your code
Test Plan & Test Cases
Ensure that your project can successfully pass all provided “public test cases.” What other test cases have you attempted?
Students should think about potential private tests – what would they be?
Your instructor will test your project using an additional set of private test cases as well as the provided public test cases
o I want to see your “thinking,” in particular, how you are testing your program
o Each submission should be rock solid, with no bugs
Capture screenshots of your test runs in your write-up as you run them
Highlight your learning experience and lessons learned
I am very interested to learn about what you have done, how you did, etc.
Anything else that you want to share with me
· Take a screen shot of the repo with the directory and files
If your project is not working as expected, submit it as-is but clearly articulate your situation in your write-up in order to potentially receive partial credit
Each student must submit one compressed (.zip) file back to the Assignment (link) with the following deliverables:
Your entire Eclipse project folder (Source code included)
Write-up as a Word or PDF file, one write-up per project
· I WILL compile, run and test every submission using a set of public and private test cases – this is how I test to ensure that your project is working correctly
· Name the compressed file (zip format) as <lastname_project_x
where x is the project number and your last name (e.g. Thai_Project_1.zip)
Double check your submission, as I can only grade what’s being submitted (don’t assume anything)
DO NOT email your submission! It won’t be accepted
Not clear? That’s okay, but do ask your questions. “I did not know” or “I did not understand” is not good enough.
Start working on each project immediately so that we can discuss any concerns or questions you have. Reminder – I am unavailable on Saturdays and have limited availability on Sundays.
Sample Test Cases & Outputs from Previous Semester (Don’t expect your project to be identical to these)
At startup
After selecting “Stack New Package” Pen(first) and Books (second).
After adding new Volunteers John (first), Nicole (second)
After adding new Recipients MC (first), Maryland (second)
After selecting Donate Package First Time
After selecting Donate Package Second time
After selecting Donate Package Third time
If the user tries to add a new volunteer and the line of volunteers is full: