You would like to offer a job as a Java developer for several candidates.
Your company has a special rule written in Java for decision-making.
boolean offerAJob =
(knowJava && yearsOfExperienceInJava >= 1) ||
(knowPython && yearsOfExperienceInPython >= 3);
A small explanation:
- knowJava is a boolean variable that shows whether the candidate knows Java or not.
- knowPython is a boolean variable that shows whether the candidate knows Python or not.
- yearsOfExperienceInJava is an int variable that shows how many years of Java programming the candidate has.
- yearsOfExperienceInPython is another int variable that shows how many years of Python programming the candidate has.
The list of candidates with their skills is the following:
- John: knowJava = true; yearsOfExperienceInJava = 1; knowPython = false; yearsOfExperienceInPython = 0;
- Mary: knowJava = false; yearsOfExperienceInJava = 0; knowPython = true; yearsOfExperienceInPython = 3;
- Olivia: knowJava = true; yearsOfExperienceInJava = 0; knowPython = true; yearsOfExperienceInPython = 2;
- Alexander: knowJava = true; yearsOfExperienceInJava = 3; knowPython = true; yearsOfExperienceInPython = 2;
- Andrew: knowJava = false; yearsOfExperienceInJava = 1; knowPython = false; yearsOfExperienceInPython = 1;
- Emily: knowJava = false; yearsOfExperienceInJava = 0; knowPython = true; yearsOfExperienceInPython = 2;
Using a decision-making rule, select all candidates that will be good for your company.