In C#, the use of uninitialized variables is not allowed. If you do not assign a default value, or use a constructor, the compiler won't know what your value is and therefore cannot use it.
You need to change double a for double varName; or double varName = new double();. The new double() operation will set the default value to zero, according to this default value table. However, = 0 is the preferred syntax.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…