Click here to Skip to main content
15,888,803 members
Home / Discussions / C#
   

C#

 
GeneralRe: Entity Framework 4 mapping problems Pin
Member 1094276011-Aug-17 9:11
Member 1094276011-Aug-17 9:11 
Questionquery to retrieve Gujarati Pin
Member 129573749-Aug-17 0:44
Member 129573749-Aug-17 0:44 
AnswerRe: query to retrieve Gujarati Pin
Afzaal Ahmad Zeeshan9-Aug-17 0:53
professionalAfzaal Ahmad Zeeshan9-Aug-17 0:53 
AnswerRe: query to retrieve Gujarati Pin
BillWoodruff9-Aug-17 15:44
professionalBillWoodruff9-Aug-17 15:44 
QuestionC# writing to a csv file, adds an extra column Pin
Member 128805958-Aug-17 23:22
Member 128805958-Aug-17 23:22 
AnswerRe: C# writing to a csv file, adds an extra column Pin
Richard Deeming9-Aug-17 1:08
mveRichard Deeming9-Aug-17 1:08 
GeneralRe: C# writing to a csv file, adds an extra column Pin
Member 128805959-Aug-17 5:23
Member 128805959-Aug-17 5:23 
QuestionHow to implement an existing methods in Visual Studio? Pin
gcobza20105-Aug-17 3:56
gcobza20105-Aug-17 3:56 
Hi Team

I am novice developer in C# and was given a test to complete. There is an existing class, but i dont know how to implement these two functions and methods; Please team i sincerely need help and once i passed it would be employed as C# developer.
using System.Collections.Generic;
using System.Linq;
using TestCode.Models;

namespace TestCode
{
public class StatsCalculator
{
public IEnumerable<team> TeamReferenceData { get; set; }
public IStatsWeighting StatsWeighting { get; set; }

public StatsCalculator(IEnumerable<team> teamReferenceData, IStatsWeighting statsWeighting)
{
TeamReferenceData = teamReferenceData;
StatsWeighting = statsWeighting;
}

// TODO: Return the player for the specified player number, or null if not located.
// The playerNumber parameter must be > 0. If it is not then return a null result.
// Note
// Team.Players has the players for the team.
// Player.PlayerNumber is the field to be compared against
public Player PlayerByPlayerNumber(int playerNumber)
{
return null;
}

// TODO: For each team return their win % as well as their players win %, sorted by the team 'win %' highest to lowest.
// If a teamId is specified then return data for only that team i.e. result list will only contain a single entry
// otherwise if the teamId=0 return item data for each team in TeamReferenceData supplied in the constructor.
// If a team is specified and cannot be located then return a empty list (list must be empty and not null).
// NB! If any player on the team has played 100 or more matches then IStatsWeighting must be invoked with the required parameters
// ONLY make this call if one or more of the player matches is >= 100.
// The result must be stored in the PlayerWeighting field inside the TeamValue result class.
// If all the players within the team has played less than 100 matches each then PlayerWeighting must be set to 0.
// Note
// Team Win % is Team.Victories over Team.Matches
// Player Win % is Player.Wins over Player.Matches i.e. the sum of all players win / matches on the team.
public IEnumerable<teamvalue> TeamWinPercentage(int teamId = 0)
{
return new List<teamvalue>();
}

}
}

// instructions for this test

What must be completed:
Inside StatsCalculator.cs are 2 methods with ToDos that must be implemented. These are PlayerByPlayerNumber and TeamWinPercentage
Read the ToDo's in order to understand what each method must do.

You must implement these 2 methods. Please implemented any tests (in the test project) you feel are relevant.
AnswerRe: How to implement an existing methods in Visual Studio? Pin
OriginalGriff5-Aug-17 4:40
mveOriginalGriff5-Aug-17 4:40 
AnswerRe: How to implement an existing methods in Visual Studio? Pin
Dave Kreskowiak5-Aug-17 7:11
mveDave Kreskowiak5-Aug-17 7:11 
QuestionWhy do libraries not help me? If I want to write parameter like myapp.exe -param1 <value> -param2 <value> .. Pin
Jens Eckervogt 4-Aug-17 13:53
Jens Eckervogt 4-Aug-17 13:53 
AnswerRe: Why do libraries not help me? If I want to write parameter like myapp.exe -param1 <value> -param2 <value> .. Pin
Richard Andrew x644-Aug-17 14:56
professionalRichard Andrew x644-Aug-17 14:56 
GeneralRe: Why do libraries not help me? If I want to write parameter like myapp.exe -param1 <value> -param2 <value> .. Pin
Jens Eckervogt 4-Aug-17 23:22
Jens Eckervogt 4-Aug-17 23:22 
GeneralRe: Why do libraries not help me? If I want to write parameter like myapp.exe -param1 <value> -param2 <value> .. Pin
PIEBALDconsult4-Aug-17 15:44
mvePIEBALDconsult4-Aug-17 15:44 
GeneralRe: Why do libraries not help me? If I want to write parameter like myapp.exe -param1 <value> -param2 <value> .. Pin
Jens Eckervogt 4-Aug-17 22:44
Jens Eckervogt 4-Aug-17 22:44 
AnswerRe: Why do libraries not help me? If I want to write parameter like myapp.exe -param1 <value> -param2 <value> .. Pin
Richard MacCutchan5-Aug-17 0:10
mveRichard MacCutchan5-Aug-17 0:10 
QuestionC# and the media player Pin
Humberto Mariles3-Aug-17 4:28
Humberto Mariles3-Aug-17 4:28 
AnswerRe: C# and the media player Pin
Pete O'Hanlon3-Aug-17 4:40
mvePete O'Hanlon3-Aug-17 4:40 
AnswerRe: C# and the media player Pin
Luc Pattyn5-Aug-17 10:59
sitebuilderLuc Pattyn5-Aug-17 10:59 
AnswerRe: C# and the media player Pin
BenScharbach12-Aug-17 9:28
BenScharbach12-Aug-17 9:28 
GeneralRe: C# and the media player Pin
Humberto Mariles22-Aug-17 8:26
Humberto Mariles22-Aug-17 8:26 
QuestionTool or style help to manage coding Pin
Kanel Roath2-Aug-17 18:17
Kanel Roath2-Aug-17 18:17 
AnswerRe: Tool or style help to manage coding Pin
BillWoodruff2-Aug-17 18:34
professionalBillWoodruff2-Aug-17 18:34 
GeneralRe: Tool or style help to manage coding Pin
Kanel Roath2-Aug-17 18:47
Kanel Roath2-Aug-17 18:47 
GeneralRe: Tool or style help to manage coding Pin
Richard MacCutchan2-Aug-17 20:43
mveRichard MacCutchan2-Aug-17 20:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.