Im getting the following error:
Cannot use local variable \'dob\' before it is declared
Here is my implementation
pu
You have reused the variable name "dob" in getFormattedDoB as a local string, which is confusing the compiler. There are 2 possible solutions:
Use this.dob in the following line to specify the class level variable (which you should probably also do because it's also good practice:
DateTime origin = DateTime.Parse(this.dob);