Closed frankcollins3 closed 1 year ago
👍
compiler seems like it's being silly because every possible case has been covered
// seems that by convention else must be provided if the current block of if code is else if. // even if all possibly cases have been provided return options in a non static function.
[8:06am]
was hung up because 2 && 3 definitely looked like correct answers. I ended up picking option 3 and failed that question but this very issue was solved by: providing else value in event that else if doesn't have one.
The issue that is returned is "Not all paths return value"
probably missing the edge case a number > 5 or so but moving on. [8:14am]
attempting to do: create string returning callback functions that take a randomly generated value and return conditionally rendered messages ("Your subscription is ending soon! Renew Now! || Your subscription is ending in {daysUntilExpired}. Renew @ 10% discount"}
error: fixed this already. didn't know. they had to be static strings as well. error CS0236: A field initializer cannot reference the non-static field, method, or property 'Program.random' [/Users/me/Desktop/CsharpProjects/TestProject/TestProject.csproj]
proposed approach: possibly since the else block hasn't been made. keeping issue open since issues keep popping up.