Question: The MedalColor Enum Code the MedalColor enum below: This enum consist of 3 constants which does not require any special treatment (such as setting any

 The MedalColor Enum Code the MedalColor enum below: This enum consist
of 3 constants which does not require any special treatment (such as
setting any Flags attribute). MedalColor enum Constants Bronze Silver Gold The Medal
Class Code the Medal class below: Create class that has five properties,
a constructor and a ToString method. All the properties are public readonly.
Medal Class Properties + Name string + TheEvent string + Color MedalColor

The MedalColor Enum Code the MedalColor enum below: This enum consist of 3 constants which does not require any special treatment (such as setting any Flags attribute). MedalColor enum Constants Bronze Silver Gold The Medal Class Code the Medal class below: Create class that has five properties, a constructor and a ToString method. All the properties are public readonly. Medal Class Properties + Name string + TheEvent string + Color MedalColor + Year int + IsRecord : bool Methods + constructor Medal name string, the Event string color string, year int, isRecord bool) + ToStringo wwwwwwwwww string Page 1 of 4 Programming 11 Medal: enums, properties, filtering a list Description of class members Properties: All the properties have public getter and the setter is absent making them all readonly properties Name - this is a string representing the holder of this object. The getter is public and the setter is absent TheEvent - this is a string representing the event of this object. (Event is a reserved word in C#). The getter is public and the setter is absent. Color - this is an enum representing the color of this object The getter is public and the setter is absent. Year- this is an integer representing the year of this object. The getter is public and the setter is absent. IsRecord - this is a bool indicating if this was a record setting event. The getter is public and the setter is absent. Fields: No fields are defined in this class Constructor: public Medal(string name, string theEvent, MedalColor color, int year, bool isRecord) This public constructor takes five arguments: a string representing the name, a string representing the event, a string representing the type of medal, an integer representing the year and a bool indicating if a World Record or Olympic Record was set in this event. It assigns the arguments to the appropriate fields. Methods: public override string ToString0 - This public method overrides the ToString of the object class. It does not take any argument and returns a string representation of the object. You may return a string in the format 2012 - Boxing(R) Narendra(Gold)". If the event is not a record event then the (R)" should not be present in the output. The ToString method is the best place to implement this feature. Page 2 of 4 Programming 11 Medal:enums, properties, filtering a list Test Harness Insert the following code statements in the Main() method of your Program.cs file: //create a medal object Medal m1 = new Medal("Horace Gwynne", "Boxing". MedalColor Gold, 2012, true); 1/print the object Console.WriteLine(ml); 1/print only the name of the medal holder Console.WriteLine(m1.Name); //create another object Medal m2 = new Medal("Michael Phelps", "Swimming". Medal Color Gold, 2012, false); //print the updated m2 Console.WriteLine(m2); //create a list to store the medal objects Listmedals = new List

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!