Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class that holds data about a job applicant. Include a name, a phone number, and four Boolean fields that represent whether the applicant

Create a class 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. Create an application that instantiates several job applicant objects and pass each in turn to a Boolean method 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.

Make sure your JobApplicant.java file runs with this file TestJobApplicants:

import java.util.Scanner; public class TestJobApplicants { public static void main(String[] args) { JobApplicant app1 = new JobApplicant("Johnson", "312-345-9875", true, false, true, false); JobApplicant app2 = new JobApplicant("Kermit", "312-543-1275", true, false, false, false); JobApplicant app3 = new JobApplicant("Lawrence", "608-288-09125", true, false, true, true); JobApplicant app4 = new JobApplicant("Mitchell", "815-288-3881", true, true, true, true); String qualifiedMsg = "is qualified for an interview "; String notQualifiedMsg = "is not qualified for an interview at this time "; if(isQualified(app1)) display(app1, qualifiedMsg); else display(app1, notQualifiedMsg); if(isQualified(app2)) display(app2, qualifiedMsg); else display(app2, notQualifiedMsg); if(isQualified(app3)) display(app3, qualifiedMsg); else display(app3, notQualifiedMsg); if(isQualified(app4)) display(app4, qualifiedMsg); else display(app4, 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, String msg) { System.out.println(app.getName() + " " + msg + " Phone: " + app.getPhone()); } }

You need to create the class JobApplicant.

It needs all the properties defined.

Create the constructor and the methods needed.

public class JobApplicant { private String name;

//The constructor. This needs to set all the properties of this class public JobApplicant(String name, String phone, boolean w, boolean s, boolean d, boolean g) { this.name = name;

}

public String getName() { return name; } public boolean getHasWordSkill() { return hasWordSkill; } }

//OUTPUT should like like this:

Johnson is not qualified for an interview at this time Phone: 312-345-9875 Kermit is not qualified for an interview at this time Phone: 312-543-1275 Lawrence is qualified for an interview Phone: 608-288-09125 Mitchell is qualified for an interview Phone: 815-288-3881

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

More Books

Students also viewed these Databases questions