secerka secerovic

secerka secerovic

  • NA
  • 12
  • 11.8k

Problem with classes and interface

Jul 17 2011 9:35 AM
Hello everyone!


I'm learning class amd interface and I have a problem.

This is just an example where I try to learn.

I have this interface and classes.


class Candidate
{
string Name { get; set; }
List<Skill> Skills { get; }
}


public class Skill
{
public string Name { get;set; }
public int Level { get;set; }

public Skill(string name, int level)
{
this.Name = name;
this.Level = level;
}

interface ICandidateSearch //interface for search
{
List<Candidate> Find(List<String> skills);
List<Candidate> Find(List<Skill> skills);

}

I would create a CandidateSearch class, which impliments
the interface and holds the list of candidates to be searched.

Each candidate has one name and more Skills and SkillLevels.

Example:

Name="Bob B.", Skill="SQL","MVC","C#", SkillLevels= 5,3,4

It is not possible to be

Bob B. C# 4

Bob B. SQL 5

because it can be done about the two men with the same name
and should be a man with more skill and skillLevel.

The point is that one kanditat has more skill and skillLevel.

I would anyone want to help me to write and publish ConsoleApplication cod.

I said that I teach class and interface.
Much easier for me to understand the whole cod than just individual parts.


An example of how an application should be:

Suppose we have a list of three candidates!

Name="Bob B.", Skill="SQL","MVC","C#", SkillLevels= 4,3,5

Name="John K.", Skill="SharePoint","SQL","C#", SkillLevels= 3,5,5

Name="Peter B.", Skill="SQL","ASP.NET","XML", SkillLevels= 5,4,4

First Search:

Our input:

Skill: C#
SkillLevels: 5

output:

Bob B.,John K.

Two Search:

Our input:

Skill: SQL
SkillLevels: 5

output:

John K.,Peter B.


Answers (7)