Skip to main content
deleted 5 characters in body
Source Link
SmallChess
  • 306
  • 3
  • 12

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.

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.

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 a HelloWorld learning exercise.

added 152 characters in body
Source Link
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 methodmethod; 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.

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. 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.

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.

added 69 characters in body
Source Link
SmallChess
  • 306
  • 3
  • 12

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 ...

There'sreturnTotal should be an anonymous function not a public method. 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.

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 ...

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.

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. 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.

Source Link
SmallChess
  • 306
  • 3
  • 12
Loading