Menu
Coddy logo textTech

Recap - Advanced Decisions

Part of the Logic & Flow section of Coddy's C# journey — lesson 12 of 66.

challenge icon

Challenge

Medium

Create a method called analyzeCandidateProfile that:

  1. Takes four parameters:
    • age (int): Candidate's age
    • experienceYears (int): Years of experience
    • skillLevel (string): Either "Beginner", "Intermediate", or "Expert"
    • hasReferences (bool): Whether the candidate has references
  2. Returns a string recommendation based on these rules:
    • "Hire Immediately" if:
      • Candidate is between 25-40 years old AND has 5+ years experience AND is "Expert" level
      • OR candidate has 10+ years experience AND has references
    • "Interview Further" if:
      • Candidate is 22+ years old AND has 3+ years experience AND is at least "Intermediate" level
      • OR candidate is 18+ years old AND has 7+ years experience
    • "Consider for Internship" if:
      • Candidate is 18+ years old AND is "Beginner" level
      • OR candidate is under 22 years old but has references
    • "Reject" in all other cases
  3. Use both complex boolean logic and either if-else or switch statements as appropriate.

Try it yourself

public class AnalyzeCandidateProfile
{
    public static string analyzeCandidateProfile(int age, int experienceYears, string skillLevel, bool hasReferences)
    {
        // Write your code here
        
    }
}

All lessons in Logic & Flow