Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

4. Support and enliven your speech with effective research

Answered: 1 week ago

Question

3. Choose an appropriate topic and develop it

Answered: 1 week ago