Calculator
540957 (7)

My attempt at making a calculator using c#

feedback is appreciated

You are viewing a single comment. View All
steamsydev (17)

Some points of advice:

  1. When converting the string from Console.ReadLine(), don't use Convert.ToDouble. This won't save you from inputs other than numbers. Use Parse() or TryParse() instead.
  2. Keep the indentation the same throughout the program, this makes it easier to read. Your final if statements have something up with their indentation, but otherwise they work fine.
  3. Try setting Number1, Number2 and Calc to static variables. This will remove the need to send them all within a function call. To do this, move them outside of the main void and into the class by itself, and adding a static before the variable type.

Good job otherwise!