using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
namespace Calculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
private void btnCompute_Click(object sender, EventArgs e)
{
float num1 = [Link]([Link]);
float num2 = [Link]([Link]);
if ()
{
[Link]("First Input Invalid!!");
return;
}
if ()
{
[Link]("First Input Invalid!!");
return;
}
string oper = [Link];
switch (oper)
{
case "+":
[Link] add = new [Link]();
[Link] = "Total" + [Link] +
[Link]([Link](Convert.ToInt16([Link]), Convert.ToInt16([Link])));
break;
case "-":
[Link] subtract = new [Link]();
[Link] = "Total" + [Link] +
[Link]([Link](Convert.ToInt16([Link]), Convert.ToInt16([Link])));
break;
case "*":
[Link] multiply = new [Link]();
[Link] = "Total" + [Link] +
[Link]([Link](Convert.ToInt16([Link]), Convert.ToInt16([Link])));
break;
case "/":
if (num1 == 0 || num2 == 0)
{
[Link]("Division by ZERO");
}
else
{
[Link] divide = new [Link]();
[Link] = "Total" + [Link] +
[Link]([Link](Convert.ToInt16([Link]), Convert.ToInt16([Link])));
}
break;
default:
[Link]("Operator is invalid");
break;
private void Form1_Load(object sender, EventArgs e)
{
string[] operators = new string[]
{
"+",
"-",
"/",
"*",
};
for (int x = 0; x < 4; x++)
{
[Link](operators[x].ToString());
}
[Link] = "0";
[Link] = "0";
[Link] = "Total: \n \r" + [Link] + "\r \n 000000";
private void txtOutput_TextChanged(object sender, EventArgs e)
{
}
}
}
using System;
using [Link];
using [Link];
using [Link];
using [Link];
namespace Calculator
{
class Calculate {
public class BasicComputation
{
public float Addition(float number1, float number2)
{
float result = number1 + number2;
return result;
}
public float Subtraction(float number1, float number2)
{
float result = number1 - number2;
return result;
}
public float Division(float number1, float number2)
{
float result = number1 / number2;
return result;
}
public float Multiply(float number1, float number2)
{
float result = number1 * number2;
return result;
}
}
}
}