You are on page 1of 14

Computer Science Department

CPCS204, Spring 2020 Program 1

Volunteer Matching Platform

Assigned: Sunday, 14th June 2020 Due: Saturday, 20th June 2020

Purpose:
1. Learn to implement a linked list for a real-world problem.
2. Review file I/O (input/output).

Read Carefully:
This program is worth 10% of your final grade.
WARNING: This is an individual project; you must solve it by yourself. Any
form of cheating will result in receiving zero in the assignment.

The deadline for this project is Saturday, 20th June 2020 by 11:59 PM.

Note: Once the clock becomes 11:59 PM, the submission will be closed!
Therefore, in reality, you must submit by 11:58 and 59 seconds.

LATE SUBMISSION: You are allowed to make a late submission, but there is a
penalty. If you submit within 24 hours of the due date (so on Sunday by 11:59 PM),
you will receive a 25% deduction. If you submit within 48 hours of the due date (so
on Monday by 11:59 PM), you will receive a 50% deduction.

Blackboard Submission:
This project must be submitted online via Blackboard.
The source file(s) of your program should be zipped up. You must name the zip
file using the following naming convention:
SectionNumber_StudentID_ProgramNumber.zip

Example: EA_1110348_P1.zip

Question: 1 2 3 Total
Points: 20 20 60 100

Score:

Mark Distribution
Concept Application & Algorithmic Part

Background:

Volunteer Matching system help non-profit organization and vounteers to find perfect volunteering
‘match’. Support volunteer into the right project for them.

The required features to be included in a volunteering platform are described as:

1. Volunteers must create their profile and describe their skills and experiences

2. Organizations must post their projects and needed skills

3. Organizations can search, filter and compare volunteers to select the best choice for their project

4. Enable volunteers and organizations to collaborate directly with each other without third-party
intervention

5. Organization can isuues volunteers certificates auotomatically.

An Example of Volunteering matching system


Question 1: (20 points)

1. Concept Application: Suppose a linked list contains the following topics of the Volunteers
profiles. Write the steps to delete all incomplete profiles. A profile is incomplete if it does not
contain a phone number or email address. Your answer must indicate:
 the position of the pointer and
 the status of the linked list after every step.

Name : Ali23
Name : Karimos Name : Mostapha9
Email : ali23@g.com
Next Email : Next Email : mos9@g.com Next
Phone :
Head 0562143163Project
Phone : Project Phone : Project
number : 0 number : 1
number : 0

Name : Aicha2020 Name : Slim21


Name : Best453
Email : aic20@g.com Email :
Email :
Next

Next
Phone :
Next

Phone :
Null Phone : Project
0599943163Project
0511243113Project number : 0
number : 1 number : 2

What are the steps used to delete incomplete nodes?

1- Ensure if list is empty or not  if (head==null)return;


2- Ensure if the head meet our condition if(head.email.equals (“”)&&head.phone.equals(“”))
3- After thar we simply delete the head using { head=head.next; return;}
4- In case our condition did not meet the condition
5- We will Create a tempy variable and assign its value to head
6- Then we loop our linkedlist with condition while(temp!=null)
7- If (temp.email.equals (“”)&&temp.phone.equals(“”))
8- In case the condition is true we disconnect the node the linkedlist will look lile :
Then

9- Whenever the condion is true we allow the following code to be excuted


10- Get the privios of node like this:
private Node getPrevious(Node c){
Node node=first;
while (node!=null){
if(node.next==c)return node;
node=node.next;
}
return null;
}
11- Disconnect the removed node and connect to its next just like this
while (temp!=null){

if (temp.email.equals("")||temp.phone. .equals("") {
Node temp2=getPrevious(temp);
temp2.next=temp.next;
System.out.println("The volunteers has been deleted!\n");
return;
}
temp=temp.next;
}
Question 2:(20 points)

2. Algorithm Write up: Suppose a linked list contains all available projects proposed by the
organizations. A Volunteer wants to find all projects matching his/her skills.
Write an algorithm that searches the linked list for projects matching the volunteer's skills.

For example, a volunteer would like to search for all web programming projects. If the linked list contains
the following nodes

Title : management website Title : website update Title : Mobile app design
Category : web programming Category : web programming Category : Mobile dev
Next

Next
Next
Organization : Aytamona Organization : Amana Organization : Albir Makkah

Title : social network Title : Advertising manag. Title : Oracle DB Migration


Category : web programming Category : Database
Next

Next
Category : Mobile dev

Next
Organization: Nabta Organization : Albir Jeddah Organization: Safi

Algorithm
public void findNodeAndPrint (String catagory){
if(head==null)return;
Node temp =head;
var i=0;
while (temp!=null){
if(temp.catagory.equals(catagory)) {
i++;
System.out.println(i+"/Project: " + temp.title+"," + temp.catagory +","+temp.organizition) ;
}
temp=temp.next;
}
}

Input:
The input is not enterd by the user and its shown in method below

Output:
1/ Project: management website, web programming, Aytamona.
2/ Project: website update, Web programming, Amana

2/ Project: social network, Web programming, Nabta

Method:
list.insert("management website","web programming","Aytamona");
list. insert("website update ","web programming","Amana");
list.insert ("Mobile app design","Mobile dev",": Albir Makkah");
list.insert("social network","web programming"," Nabta");
list.insert("Advertising manag"," Mobile dev","Aytamona");
list.insert("Oracle DB Migration","Database","Safi");
Question 3:(60 points)

Program: Volunteering Matching Platform

Objective

The primary objective of this program is to implement a linked list. The secondary objective
is to practice with File I/O.

Program Description

Write a program to manage a Volunteering Matching Platform


 The first input/output file is volunteers.txt, each volunteer contains (pseudo-name,
name, email, phone, skills, experience, previous projects: an array of the previous
projects including project Id).
 A volunteer can enroll in a project.
 The organization must select a volunteer from among several participants in the
project.
 The second file projectss.txt contains projects information; each project contains
(project Id, organization, title, description, status).
 The status of a project can be “not started”, "in progress" or "completed".

1. Write a function to register a new volunteer and to add it to volunteers.txt.


2. Write a function to post a new project and to add it to projects.txt.
3. Create a linked list for volunteers who have a valid account. A volunteer has a valid
account if their account contains an email or phone number.
4. Write a function to find all not-started projects matching volunteers’s skills.
5. Delete a project by Project Id

Volunteer nam Previous project


Email phone skills experience
pseudoName e ID (Max 3)
NEXT

Anis98@g.co Web 25
Anis98 Anis 0569994523 3 5
m design projects

Projec compan
title description category status
t Id y
NEXT

Design Looking for someone who can


social create a beautifulVolunteer
design for node Web not-
5 Nabta
networ social network app with Arabic design started
k language themes

Project node
Your program will take new volunteer information and new project information to store
it in files. The program then reads a text file as input (volunteers.txt) which the
information will be retrieved. The basic functionality of Volunteering Matching
Platform will be implemented using two linked lists. The basic algorithm is as follows:

Read the volunteers text document


For each volunteer in the file
If the volunteer account is valid
Add the volunteer to the list
Read the project text document
For each project in the file, Add the project to the list
For each search attempt, check all current projects whose category matches the volunteer's
skills
Print the list of all projects.

 To read the document use the Scanner() method


 To iterate over each volunteer or project in the documents use Scanner.next() method
 To add the volunteer to the list, create a new volunteer node, and check the
availability of pseudoName, the pseudoName must be unique.
 To check the presence of a volunteer in the list, use the method checkPseudoName
Public boolean checkPseudoName ( String pseudo) {
..
...
}
 To add a project to the list, create a new project node, and check the availability of
ProjectID.
 To check the presence of a project in the list, use the check_Id method.
Public boolean check_ProjectId ( String projectId) {
..
...
}

 To remove a project by using the projectId, the project Id must not be used in the
previous project field of any volunteer.

Implementation

For this program, you will create the following classes:

 volunteer.java: This class will be used to create objects (nodes) of type volunteer.
Each volunteer object (node) will store the pseudo-name, name, email, phone, the
volunteer's experience (number of completed projects), and an array of the three
previous completed projects.

 project.java: This class will be used to create objects (nodes) of type project. Each
project object (node) will store the project Id, organization, title, project description,
category, and status.

 volunteerMatchingPlatform.java: All the methods will be implemented in this class.


 StdMenue.java: This is the class that will contain the main. This class also prints the
menu, and the user should select his option.

Input File Specifications

You will need to add a new volunteer to the file and read current information from text file.
This should be automated when the user selects to add a new volunteer or select to display
the current list.

Volunteers.txt:

Let’s assume that the volunteers.txt consists of the following information:

PseudoName ,Name,Email,Phone,Skills,Experience , Project-ID-1,Project-ID-2,Project-ID-3#


Anis98,Anis,Anis98@kaumail.com,0536215423,web dev,5,1,3#
Sana2000,sana,sana2000@kaumail.com, ,network administration ,1, 2#
AbdAllah98,AbdAllah, , ,mobile dev,2,4#

volunteers.file.example

Projects.txt:

Let’s assume that the Projects.txt consists of the following information:

Project Id,company,title,description,category, status#


1,Nabta, website,Looking for someone who can create,web dev, not started,#
2,Albir , social network,We need a volunteer that ,web design , not started,#
6, Safi,plugin for windows desktop,We need ,system dev, completed #

projects.file.example

The menu to be implemented are as follows

The user should select from the menu. The user will be allowed to reselect from the menu
until press 8 to exit.

1. Add a new volunteer


2. Add a new project
3. Print volunteer list with a valid account
4. Print ‘not started’ project list
5. Search projects for volunteer
6. Remove project by project Id
7. Exit.
1. Add a new volunteer
This selection will allow the user to enter the volunteer information using volunteer.java and
store the information in volunteer.txt.
Note: the system should check whether the volunteer pseudoName already exists in the list.

Example Intput:
Please enter the volunteer information:

PseudoName: Anis98
Name: Anis
Email: Anis98@kaumail.com
Phone: 0536215423
Skills: web dev
Experience:5
Project-ID-1:1
Project-ID-2:2
Project-ID-3
The volunteer is added!

Please enter the volunteer information:

PseudoName: Anis98

The volunteer already exists!

2. Add a new project

This selection will allow the organization to post a new project information using project.java
and store the information in projects.txt.
Note: the system should check whether the projectId already exists in the list.

Example Intput:
Please enter the project information:

Project Id: 1
Company: Aytamona
Title: management website
Description: Looking for someone who can create…
Category: web dev

The project is added!

Please enter the project information:

Project Id: 1
This project already exists!
3. Print volunteer list with a valid account

If we use the volunteer.file.example file as input without adding any other volunteers, the
output will be as follows

Example Output:

Nam Prjct- Prjct-


Pseudo Email Phone Skills Exp. Pjct-Id1
e Id2 Id3
Anis98 Anis Anis98@kaumail.com 0536215423 web dev 5 1 3
Sana200 sana2000@kaumail.co network
0
Sana
m administration
1 2

4. Print ‘not started’ project list

If we use the project.file.example file as input without adding any other projects, the output
will be as follows

Example output:

Project
company title description category status
Id
Ecommer Looking for someone who can
1 Nabta web dev not started
ce website create…
KAU
web
2 Kau social We need a freelancer that… not started
design
network

Note: you have to display the volunteer list and not started project list in a table format,
you might need printf.

5. Search projects for volunteer

Example Input:

Please enter the information related to the project:

skill: web design

Example Output:

Project
company title description category status
Id
social web
2 Nabta We need a volunteer that… not started
network design
6. Remove project by project Id

Example Intput:

Please enter the projectId of the project to be deleted:

Project Id: 6

The project has been deleted!

Please enter the projectId of the project to be deleted:

Project Id: 1

This project cannot be deleted!

Note: This project can't be deleted because it is listed in the volunteer Anis98's projects.

Sample Input & Output File

You must print your output to an output file called output.txt. We have provided you
a sample input with matching output.

***WARNING***
Your program MUST adhere to the EXACT format shown in the sample output file (spacing
capitalization, use of dollar signs, periods, punctuation, etc). The graders will use large input
files, resulting in large output files. As such, the graders will use text comparison programs to
compare your output to the correct output. If, for example, you have two spaces between in
the output when there should be only one space, this will show up as an error even though
you may have the program correct. You will get points off if this is the case, which is why
this is being explained in detail. The minimum deduction will be 10% of the grade, as the
graders will be forced to go to the text editing of your program in order to give you an
accurate grade. Again, your output MUST ADHERE EXACTLY to the sample output.

Grading Details

Your program will be graded upon the following criteria:


1) Adhering to the implementation specifications listed on this write-up.
2) Your algorithmic design.
3) Correctness.
4) Use of the three classes, as specified. If your program is missing these elements,
you will get a zero.
5) The frequency and utility of the comments in the code, as well as the use of white space
for easy readability. (If your code is poorly commented and spaced and works
perfectly, you could earn as low as 80-85% on it.)
6) Compatibility to the newest version of NetBeans. (If your program does not compile
in NetBeans, you will get a large deduction from your grade.)
7) Your program should include a header comment with the following information:
your name, email, account number, section number, assignment title, and date.
8) Your output MUST adhere to the EXACT output format shown in the sample output file.

Deliverables
You should submit a zip file with five files inside:
1. ConceptPart.doc (Containing concept and algorithm parts)
2. Volunteer.java
3. Project.java
4. VolunteerMatchingPlatform.java
5. StdMenu.java

***These five files should all be INSIDE the same package called
VolunteerMatchingPlatform If they are not in this specific package, you will lose points.

NOTE: your name, ID, section number AND EMAIL should be included as comments
in all files!

UML Diagrams:

For this program, you will create four Classes (UML diagram shown below):

Volunteer Project

Data Members
private String pseudoName; Data Members
private String name; private String projectId;
private String email; private String organization;
private String phone; private String title;
private String skills; private String description;
private int experience; private String category;
private Enumeration status;
private int [3] prevProject;
private Project next;
private Volunteer next;

Operations/Methods Operations/Methods
volunteer() // one or more Constructors project()// one or more Constructors

And any other methods you


And any other methods you need. need.

VolunteerMatchingPlatform
Data Members Data Members
private Volunteer headFL; As needed
private Project headPL;
Operations/Methods Operations/Methods
checkProjectId ()
checkPseudoName() public static void main()
printValidVolunteerList ()
printNotStartedProject() ALL necessary methods for linked-list operations
searchProject()
removeProject()

ALL necessary methods for linked-list operations

You might also like