Question: Create a class in JobApplicant.java that holds data about a job applicant. Include a name, a phone number, and four Boolean fields that represent whether

Create a class in JobApplicant.java that holds data about a job applicant. Include a name, a phone number, and four Boolean fields that represent whether the applicant is skilled in each of the following areas: word processing, spreadsheets, databases, and graphics. Include a constructor that accepts values for each of the fields. Also include a get method for each field. The get method should be the field name prefixed with 'get'. For example, the get method for name should be called getName.

Create an application in TestJobApplicants.java that instantiates several job applicant objects and pass each in turn to a Boolean method named isQualified that determines whether each applicant is qualified for an interview. Then, in the main() method, display an appropriate method for each applicant. A qualified applicant has at least three of the four skills.

This is the code that I have but it is only 66% correct:

public class JobApplicant { String name; String phone; boolean hasWordSkill,hasSpreadsheetSkill,hasDatabaseSkill,hasGraphicsSkill; public JobApplicant(String name, String phone, boolean w, boolean s, boolean d, boolean g) { this.name = name; this.phone = phone; this.hasWordSkill = w; this.hasSpreadsheetSkill = s; this.hasDatabaseSkill = d; this.hasGraphicsSkill = g; } public String getName(){ return this.name; } public String getPhone(){ return this.phone; } public boolean gethasWordSkill(){ return this.hasWordSkill; } public boolean gethasSpreadSheetSkill(){ return this.hasSpreadsheetSkill; } public boolean gethasDataBaseSkill(){ return this.hasDatabaseSkill; } public boolean gethasGraphicsSkill(){ return this.hasGraphicsSkill; } public String tostring(){ return "Name:"+ this.getName() + " Phone: " + this.getPhone() + " hasWordSkills: "+ this.gethasWordSkill() + " hasSpreadSheetSkills: "+ this.hasSpreadsheetSkill +" DataBasesSkills: "+ this.gethasDataBaseSkill() +" GraphicSkills: "+ this.gethasGraphicsSkill(); } }

public class TestJobApplicants {

public static void main(String[] args) { JobApplicant app1 = new JobApplicant("Swarup","8977924083",true,false,true,false); JobApplicant app2 = new JobApplicant("Alisa","9168493867",false,false,false,true); JobApplicant app3 = new JobApplicant("John","8522948572",true,true,true,false); JobApplicant app4 = new JobApplicant("Mahesh","95739485726",true,true,true,false); String qualifiedMsg = "is qalified for an interview "; String notQualifiedMsg = "is not qualified for an interview at this time "; boolean b1= isQualified(app1); boolean b2= isQualified(app2); boolean b3= isQualified(app3); boolean b4=isQualified(app4); display(app1); if(b1) System.out.println(qualifiedMsg); else System.out.println(notQualifiedMsg); display(app2); if(b2) System.out.println(qualifiedMsg); else System.out.println(notQualifiedMsg); display(app3); if(b3) System.out.println(qualifiedMsg); else System.out.println(notQualifiedMsg); display(app4); if(b4) System.out.println(qualifiedMsg); else System.out.println(notQualifiedMsg); } public static boolean isQualified(JobApplicant app) { int count = 0; boolean isQual; final int MIN_SKILLS = 3; if(app.gethasWordSkill()) count = count + 1; if(app.gethasSpreadSheetSkill()) count = count + 1; if(app.gethasDataBaseSkill()) count = count + 1; if(app.gethasGraphicsSkill()) count = count + 1; if(count >= MIN_SKILLS) isQual = true; else isQual = false; return isQual; } public static void display(JobApplicant app) { System.out.println(app.tostring()); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!