Question
Introduction For this assignment you will create classes and methods that will be used to develop an application for an employment agency. The end goal
Introduction
For this assignment you will create classes and methods that will be used to develop an application for an employment agency. The end goal is to identify potential candidate interviewees for a job.
Each question involves the creation of a .txt file as output. You need to create all of the classes yourself as well as most of the .txt files.
Please do NOT specify any path names. For example, you would make use of the following relative path when creating/using a file:
Path fileIn = Paths.get("dirtycv.txt");
The only validation that is required is stated in the exercises below.
As you do each question, you are strongly recommended to check that the functionality you added in the previous exercise still works. This is called regression testing.
Creating an application to produce a file that lists potential candidates for a job interview.
As discussed, employment agencies find it difficult to examine hundreds of CVs to determine who needs to be interviewed. It is therefore very difficult for agencies to properly extract information from CVs, and potentially good candidates may not be highlighted.
You have been tasked with writing a Java application to produce an automated list of potential candidates to be interviewed, stored in a series of files. Each question produces a file. It is important that a file is produced as this is what will be marked.
Question 1: [30]
Write a Java class called CleaningUp with methods that will take an existing file (the dirtycv.txt that has been given to you) and clean the file up. The cleaned-up version must be written to a new file called cleancv.txt file.
For question 1 create a method public void cleanUpFile(). You have been given the dirtycv.txt file (to be used as input / read). The method must re-structure the dirtycv.txt file so that each candidate can be viewed as a record, taking up exactly 1 line in the new file (the cleancv.txt). For example, CV 1 is John Smith in the dirtycv.txt file and appears as follows:
CV 1 Surname:Smith First Name:John Address:1 Whatever Street Qualification:Degree in Computer Science Position:Data Analyst Experience:5 Position:Computer programmer Experience:2 eMail:smithj@lol.com End
Once this CV is cleaned up it should appear as follows in the cleancv.txt file:
Smith0001,Degree in Computer Science,Data Analyst,5,Computer programmer,2,smithj@lol.com,
Take note that there are 5 CVs in the dirtycv.txt file and that means there needs to be 5 lines (records) in the cleancv.txt file (see above for the complete example).
The dirtycv.txt file needs to be cleaned up so that each line is formatted accordingly:
Identifier,qualification,position,experience,position,experience,eMail,
Identifier Smith0001
Qualification Degree in Computer Science
Position Data Analyst
Experience 5 (this would be 5 years)
Position Computer programmer
Experience 2
eMail smithj@lol.com
Remember that this is an example illustrating what the output could look like. This is not to say that it will always be John Smith.
Take note of the following:
- The identifier needs to be generated, i.e. Smith0001 (it is mandatory that there is a 000 placed in front of the 1. So, CV 1 correlates to Smith0001;
- This is a comma separated file;
- There are no spaces between commas;
- The last character in the line is a comma;
- There are variations between CVs in the dirtycv.txt file, for example CV 2 has no address. Create a main() method in its own class (JobCandidatesMain) and test the program before continuing. To summarise, at the end of this question you should produce a file called the cleancv.txt file. The contents of the file should appear as follows:
Smith0001,Degree in Computer Science,Data Analyst,5,Computer programmer,2,smithj@lol.com, Harrison0002,None,harrisonj@lol.com, Jones0003,Masters in Computer Science,Operator,10,Computer programmer,2,jonesr@lol.com, Ngomi0004,Degree in Computer Science,Programmer,10,ngomim@lol.com,
Chen0005,Masters in Computer Science,Programmer,7,chenc@lol.com,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started