Properly encapsulate the following class. Use traditional getters and setters (accessors and mutators) or Properties. En
Posted: Tue Jul 12, 2022 8:09 am
Properly encapsulate the following class. Use traditional getters and setters (accessors and mutators) or Properties. Ensure that the class cannot be put into an invalid state (no name and/or age < 0). public class Person { public string name; public int age; public Speed walkingSpeed; public Person(string name, int age, Speed walkingSpeed) { } ENCUEN RUCI this.name = (name == "") ? "unnamed one" : name; this.age = (age < 0) ? 0: age; this.walkingSpeed = walkingSpeed; public enum Speed { Slow, Medium, Fast };