Skip to main content
3 of 4
added 152 characters in body
BCdotWEB
  • 11.4k
  • 2
  • 28
  • 45

switch in C# and all programming languages I am aware of require a constant label. You should not use it to test for > and <=, that's the job for if.

https://msdn.microsoft.com/en-us/library/06tc147t.aspx

... Each case label specifies a constant value ...


returnTotal should be an anonymous function not a public method; the method name should also be PascalCase.


Otherwise, there's nothing wrong with your program, nor anything interesting. For your record, a "real" business application doesn't code the program logic in Main. What you did was like just a HelloWorld learning exercise.

SmallChess
  • 306
  • 3
  • 12