Esempio n. 1
0
 protected void sum_Click(object sender, EventArgs e)                        // Button click event for sum button
 {
     Models.Operations sumOperation = new Models.Operations();               // Initializes a new object of the Models.Operations class
     sumOperation.getUserInput(Convert.ToInt32(inputTxt.Text));              // Assigns user input from the inputTxt text field
     result.Text = sumOperation.Sum().ToString();                            // Assigns the result value to the result label, prints the result as a string value
 }
Esempio n. 2
0
 protected void factorial_Click(object sender, EventArgs e)                 // Button click event definition for factorial button
 {
     Models.Operations factorialOperation = new Models.Operations();        // Initializes a new object of the Models.Operations class
     factorialOperation.getUserInput(Convert.ToInt32(inputTxt.Text));       // Assigns user input from the inputTxt text field
     result.Text = factorialOperation.Factorial().ToString();               // Assigns result value to the result label, prints the result as a string value
 }