Skip to content
Open

Ateeb #108

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions csharp-fundamentals-lists.Main/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Core

public Core()
{

}

public List<string> Question1()
Expand All @@ -32,16 +32,20 @@ public List<string> Question1()

//write code here

return _iceCreams;
_iceCreams.Add("Phish Food");
_iceCreams.Add("Peanut Butter Cup");


return _iceCreams;
}

public int Question2()
{

//TODO: find the lists method that returns the number of ice creams in the list and return this.

// remove exception and write code here
throw new NotImplementedException();
return _iceCreams.Count;
}
public List<string> Question3()
{
Expand All @@ -50,8 +54,8 @@ public List<string> Question3()
//TODO: you can 'chain' methods on the _iceCream list, so add another Concat to include EvenMoreIceCream (this is defined below) to the result list . e.g. _iceCreams.Concat(this.MoreIceCream).Concat(other list to concat).ToList()

List<string> results = _iceCreams.Concat(this.MoreIceCream).ToList();
return results;

return results.Concat(this.EvenMoreIceCream).ToList();

// remove exception and write code here

Expand All @@ -67,6 +71,8 @@ public List<string> Question4()

List<string> results = _iceCreams;
// remove exception and write code here
results = _iceCreams.Concat(this.MoreIceCream).Concat(this.EvenMoreIceCream).Distinct().ToList();

return results;
}

Expand Down