Initial commit

This commit is contained in:
github-classroom[bot] 2024-11-16 13:07:55 +00:00 committed by GitHub
commit 09eb0da6cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 1014 additions and 0 deletions

24
Marathons/Program.cs Normal file
View file

@ -0,0 +1,24 @@
using System.Text;
using Marathons;
Console.OutputEncoding = Encoding.UTF8;
Console.WriteLine("*** Marathon ***");
var p1 = new Participant(591, "Jeb", new TimeSpan(2, 05, 41));
var p2 = new Participant(24, "Bill", new TimeSpan(4, 15, 23));
var p3 = new Participant(167, "Bob", new TimeSpan(3, 34, 18));
var p4 = new Participant(408, "Val", new TimeSpan(2, 05, 41));
var marathon = new Marathon("Linz", new DateOnly(2024, 10, 30));
marathon.AddParticipant(p1);
marathon.AddParticipant(p2);
marathon.AddParticipant(p3);
marathon.AddParticipant(p4);
marathon.RemoveParticipant(p2.StartNo);
Console.WriteLine($"Here are the results for {marathon}:");
foreach (var resultLine in marathon.GetResultList())
{
Console.WriteLine(resultLine);
}