Skip to content

Commit 523e38c

Browse files
author
Chris Sivert Sylte
committed
finished core
1 parent 0dd078a commit 523e38c

File tree

1 file changed

+9
-3
lines changed
  • csharp-fundamentals-lists.Main

1 file changed

+9
-3
lines changed

csharp-fundamentals-lists.Main/Core.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,21 @@ public List<string> Question1()
3232

3333
//write code here
3434

35+
_iceCreams.Add("Banana");
36+
_iceCreams.Add("Oreo");
37+
3538
return _iceCreams;
3639
}
3740

3841
public int Question2()
3942
{
40-
43+
4144
//TODO: find the lists method that returns the number of ice creams in the list and return this.
4245

4346
// remove exception and write code here
47+
48+
_iceCreams.ToList();
49+
4450
throw new NotImplementedException();
4551
}
4652
public List<string> Question3()
@@ -49,7 +55,7 @@ public List<string> Question3()
4955
// The code below concatenates this.MoreIceCream to the _iceCreams list into a new results list.
5056
//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()
5157

52-
List<string> results = _iceCreams.Concat(this.MoreIceCream).ToList();
58+
List<string> results = _iceCreams.Concat(this.MoreIceCream).Concat(this.EvenMoreIceCream).ToList();
5359

5460
return results;
5561

@@ -65,7 +71,7 @@ public List<string> Question4()
6571
// be sure to include the MoreIceCream and EvenMoreIceCream lists
6672

6773

68-
List<string> results = _iceCreams;
74+
List<string> results = _iceCreams.Concat(this.MoreIceCream).Concat(this.EvenMoreIceCream).Distinct().ToList();
6975
// remove exception and write code here
7076
return results;
7177
}

0 commit comments

Comments
 (0)