I have tried to write basic calculator code which also calculate surface area of the circle.
I created classes needed for this task but struggle with Main method defining. Can someone help me to complete this coding?
class Calculator
{
private Double _num1;
private Double _num2;
public Double PI
{
get
{
return Math.PI;
}
}
public Calculator(Double num1, Double num2)
{
this._num1 = num1;
this._num2 = num2;
}
public void WriteNumber1()
{
Console.WriteLine(this._num1);
}
public void WriteNumber2()
{
Console.WriteLine(this._num2);
}
public Double Add()
{
return this._num1 + this._num2;
}
public Double Subtract()
{
return this._num1 - this._num2;
}
public Double Multiply()
{
return this._num1 * this._num2;
}
public Double Divide()
{
return this._num1 / this._num2;
}
public static Double Add(Double num1,Double num2)
{
return num1 + num2;
}
public static Double Subtract(Double num1, Double num2)
{
return num1 - num2;
}
public static Double Multiply(Double num1, Double num2)
{
return num1 * num2;
}
public static Double Divide(Double num1, Double num2)
{
return num1 / num2;
}
public static Double cicrcle(Double r)
{
return Math.PI * 2 * r;
}
}