Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a Web Forms project called Assignment4 that that is essentially the same

ID: 3753829 • Letter: C

Question

Create a Web Forms project called Assignment4 that that is essentially the same as the Calculator project from assignment 2; however, this time create private methods called AddNumbers(), SubtractNumbers(), MultiplyNumbers(), and DivideNumbers() . Each of these methods should have two parameters of type int and return an int value. Here is how it should work:
When the + button is clicked, the click event handler method should pass the two numbers to the AddNumbers() method, where they are added and the result is sent back to the click event handler. In the click event handler, the result is assigned to the Text property of the result TextBox. When the - button is clicked, the click event handler method should pass the two numbers to the SubtractNumbers() method, where they are subtracted and the result is sent back to the click event handler. In the click event handler, the result is assigned to the Text property of the result TextBox. When the * button is clicked, the click event handler method should pass the two numbers to the MultiplyNumbers() method, where they are multiplied and the result is sent back to the click event handler. In the click event handler, the result is assigned to the Text property of the result TextBox. When the / is clicked, the click event handler method should pass the two numbers to the DivideNumbers() method, where they are divided and the result is sent back to the click event handler. In the click event handler, the result is assigned to the Text property of the result TextBox.

This was the calcuator assignment:::::

For this assignment you are going to create a Web Forms project that has a Web Form item called Calculator.aspx. This form should have the following controls:
3 Label controls that display “First Number:”, “Second Number”, and “Result” 3 TextBox controls that correspond to each of the above Labels respectively. 4 Buttons for addition, subtraction, multiplication, and division.

Explanation / Answer

Hi please go thew the code .

<!DOCTYPE html>

<html>

<head>

<title>practical</title>

<script>

function calc()

{

var n1=parseInt(document.getElementById("n1").value);

var n2=parseInt(document.getElementById("n2").value);

var oper=document.getElementById("operators").value;

if(oper == '+')

{

var n2= document.getElementById('result').value=n1+n2 ;

}

if(oper == '-')

{

var n2=document.getElementById('result').value=n1-n2 ;

}

if(oper == '*')

{

var n2=document.getElementById('result').value=n1*n2 ;

}

if(oper == '/')

{

var n2=document.getElementById('result').value=n1/n2 ;

}

}

</script>

</head>

<body>

<form>

<lable>Enter First Number:</lable>

<input type="number" name="f_numebr" id="n1"/>

<br>

<lable>Enter Second Number:</lable>

<input type="number" name="s_number" id="n2" /><br>

<select id="operators">

<option value="+">+</option>

<option value="-">-</option>

<option value="*">*</option>

<option value="/">/</option>

</select>

<button>=</button>

<input type="text" id="result" />

</form>

</body>

</html>