:sectnums: :nofooter: :toc: left :icons: font :data-uri: :source-highlighter: highlightjs :stem: latexmath = Col.01 -- Marathon Results This time you will create an application which manages results of a marathon run and converts those individual results into an _ordered_ list. [plantuml,id=class_diagram] ---- @startuml class Participant { +int StartNo [readonly] +string Name [readonly] +TimeSpan CompletionTime [readonly] +Participant(int, string, TimeSpan) +int CompareTo(Participant) +string ToString() [override] } class Marathon { -Node? _head; +string City [readonly] +DateOnly Date [readonly] +int ParticipantCount [private set] +Marathon(string, DateOnly) +void AddParticipant(Participant) +bool RemoveParticipant(int) +string[] GetResultList() +string ToString() [override] } Participant "n"-r-"0..1" Marathon: participates @enduml ---- WARNING: As usual, you might have to initially comment some code to allow the application to compile. == `Participant` The participant is very simple and mostly just a data container. Each instance represents one runner who completed the marathon (for simplicity we are not dealing with half-marathons and the like). The two interesting bits are: * `CompareTo` ** Compares two instances of the `Participant` class ** First completion times is compared, lower time means higher rank => comes earlier in the list ** If the completion time of two participants is the same compare the start number *** Business rules dictate, that no two people can have the same start number * `ToString` ** Has to follow the format ` (Start# ) finished in