Question

Bottom section is the what they expect in the code in java Create a class in...

Bottom section is the what they expect in the code in java

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. Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade. Once you are happy with your results, click the Submit button to record your score.

public class JobApplicant {
private String name;
private String phone;
private boolean hasWordSkill;
private boolean hasSpreadsheetSkill;
private boolean hasDatabaseSkill;
private boolean hasGraphicsSkill;
public JobApplicant(String name, String phone, boolean w, boolean s, boolean d, boolean g) {
}
public String getName() {
}
public String getPhone() {
}
public boolean getHasWordSkill() {
}
public boolean getHasSpreadsheetSkill() {
}
public boolean getHasDatabaseSkill() {
}
public boolean getHasGraphicsSkill() {
}
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please follow the step by step instructions to get the exact output without any confusion.

Step1: Create a java class file named JobApplicant.java

Code as:

JobApplicant.java

public class JobApplicant {
private String name;
private String phone;
private boolean hasWordSkill;
private boolean hasSpreadsheetSkill;
private boolean hasDatabaseSkill;
private boolean hasGraphicsSkill;
public JobApplicant(String name, String phone, boolean w, boolean s, boolean d, boolean g) //constructor to initialize values
{
this.name=name;
this.phone=phone;
hasWordSkill=w;
hasSpreadsheetSkill=s;
hasDatabaseSkill=d;
hasGraphicsSkill=g;
}
//get methods, name and phone of applicant
public String getName()
{
return name;
}
public String getPhone()
{
return phone;
}
public boolean getHasWordSkill()
{
return hasWordSkill;
}
public boolean getHasSpreadSheetSkill()
{
return hasSpreadsheetSkill;
}
public boolean getHasDatabaseSkill()
{
return hasDatabaseSkill;
}
public boolean getHasGraphicsSkill()
{
return hasGraphicsSkill;
}
} //end of class JobApplicant  

Step2: Now create a java class file named TestJobApplicant.java

Code as:

TestJobApplicant.java

public class TestJobApplicant{
public static void main(String[] args){
JobApplicant app1 = new JobApplicant("Peter", "123-124-4534",true,false,true,false);
JobApplicant app2 = new JobApplicant("John", "123-125-4534",true,false,true,true);
JobApplicant app3 = new JobApplicant("Kate", "123-126-4534",true,false,false,true);
JobApplicant app4 = new JobApplicant("Miley", "123-127-4534",true,true,true,true);

// Four applicant objects

String qualifiedMsg="is qualified for an interview. Good luck!";
String notqualifiedMsg="is not qualified for an interview at this time. Better luck next 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)

// Function to check whether the applicant is qualified or not
{

boolean isQual; // Variable to check whether the applicant is qualified or not.
int count=0;
if(app.getHasWordSkill())
count++;
if(app.getHasSpreadSheetSkill())
count++;
if(app.getHasDatabaseSkill())
count++;
if(app.getHasGraphicsSkill())
count++;
if(count>= 3)
isQual=true;
else
isQual=false;

return isQual;

}

public static void display(JobApplicant app, String msg)

//Function to display the status of applicants with their phone numbers
{
System.out.println(app.getName() + " " + msg + " Phone: " + app.getPhone());


}

} //End of class TestJobApplicant

Step3: Now run the java file named TestJobApplicant.java

Step4:Output is displayed as:

run:
Peter is not qualified for an interview at this time. Better luck next time! Phone: 123-124-4534
John is qualified for an interview. Good luck! Phone: 123-125-4534
Kate is not qualified for an interview at this time. Better luck next time! Phone: 123-126-4534
Miley is qualified for an interview. Good luck! Phone: 123-127-4534
BUILD SUCCESSFUL (total time: 0 seconds)

-----------------------------------------------------------------------------------

Hope this gives you a perfect solution. Please rate.ThankYou.

Add a comment
Know the answer?
Add Answer to:
Bottom section is the what they expect in the code in java Create a class in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create an abstract Student class for Parker University. The class contains fields for student ID number,...

    Create an abstract Student class for Parker University. The class contains fields for student ID number, last name, and annual tuition. Include a constructor that requires parameters for the ID number and name. Include get and set methods for each field; the setTuition() method is abstract. Create three Student subclasses named UndergraduateStudent, GraduateStudent, and StudentAtLarge, each with a unique setTuition() method. Tuition for an UndergraduateStudent is $4,000 per semester, tuition for a GraduateStudent is $6,000 per semester, and tuition for...

  • java This lab is intended to give you practice creating a class with a constructor method,...

    java This lab is intended to give you practice creating a class with a constructor method, accessor methods, mutator methods, equals method , toString method and a equals method. In this lab you need to create two separate classes, one Student class and other Lab10 class. You need to define your instance variables, accessor methods, mutator methods, constructor, toString method and equals method in Student class. You need to create objects in Lab10 class which will have your main method...

  • USING THIS CODE: #include <iostream> #include <string> using namespace std; class Contact { //this class cannot...

    USING THIS CODE: #include <iostream> #include <string> using namespace std; class Contact { //this class cannot be viewed from outside of the private class. //only the class functions within the class can access private members. private: string name; string email; string phone; //the public class is accessible from anywhere outside of the class //however can only be within the program. public: string getName() const { return name; } void setName(string name) { this->name = name; } string getEmail() const {...

  • Required in Java. Thank you. 1. Create a base class called Vehicle that has the manufacturer's...

    Required in Java. Thank you. 1. Create a base class called Vehicle that has the manufacturer's name (type String), number of cylinders in the engine (type int), and owner (type Person given in Listing 8.1 in the textbook and in LMS). Then create a class called Truck that is derived from Vehicle and has additional properties: the load capacity in tons (type double, since it may contain a fractional part) and towing capacity in tons (type double). Give your classes...

  • In Java, Write a class encapsulating a restaurant,which inherits from Store. A restaurant has the following...

    In Java, Write a class encapsulating a restaurant,which inherits from Store. A restaurant has the following additional attributes: how many people are served every year and the average price per person. code the constructor, accessors, mutators, toString and equals method of the new subclass; also code a method returning the average taxes per year. You also need to include a client class to test your code for both the parent class and the subclass. Code for Store below(Super class aka...

  • Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super...

    Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super class. The class includes four private String instance variables: first name, last name, social security number, and state. Write a constructor and get methods for each instance variable. Also, add a toString method to print the details of the person. After that create a class Teacher which extends the class, Person. Add a private instance variable to store number of courses. Write a constructor...

  • Java Do 72a, 72b, 72c, 72d. Code & output required. public class Employee { private int...

    Java Do 72a, 72b, 72c, 72d. Code & output required. public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...

  • Create a java class that implements BagInterface using singly linked data. Name this new class LinkedBag....

    Create a java class that implements BagInterface using singly linked data. Name this new class LinkedBag. Be sure to include a default constructor to initialize the private members of the class. Test that your code works properly. BagInterface includes the methods:  public int getCurrentSize(); public boolean isEmpty(); public boolean add(T newEntry); public T remove(); public boolean remove(T anEntry); public void clear(); public int getFrequencyOf(T anEntry); public boolean contains(T anEntry); public T[] toArray();

  • JAVA /** * This class stores information about an instructor. */ public class Instructor { private...

    JAVA /** * This class stores information about an instructor. */ public class Instructor { private String lastName, // Last name firstName, // First name officeNumber; // Office number /** * This constructor accepts arguments for the * last name, first name, and office number. */ public Instructor(String lname, String fname, String office) { lastName = lname; firstName = fname; officeNumber = office; } /** * The set method sets each field. */ public void set(String lname, String fname, String...

  • JAVA help Create a class Individual, which has: Instance variables for name and phone number of...

    JAVA help Create a class Individual, which has: Instance variables for name and phone number of individual. Add required constructors, accessor, mutator, toString() , and equals method. Use array to implement a simple phone book , by making an array of objects that stores the name and corresponding phone number. The program should allow searching in phone book for a record based on name, and displaying the record if the record is found. An appropriate message should be displayed if...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT