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

Create a form with 2 text fields. In each number ask the user to enter a number.

ID: 3676123 • Letter: C

Question

Create a form with 2 text fields. In each number ask the user to enter a number.
Then have 3 radio buttons: Add, Subtract, Multiply. (Again, note that these must be radio buttons, not a select box).

Suppose the user enters 5 and 7, and chooses the ‘Add’ button. You should output in your results section: The sum of your numbers is 12.
If they chose multiply, you would say: The product of your numbers is 35.
And if they chose subtract you would say: The difference in your numbers is ­2. place the results sentence in a div section called ‘results’. Have a ‘main_content’ div for the whole page, and a div (inside main_content) where you will output your results as discussed in lecture. Give the ‘main_content’ div a width of 400 pixels and a border. Give the ’results’ div a background color. Style your two div sections using inline styles.

Explanation / Answer

private void btnresult_Click(object sender, EventArgs e)
{
int result;
if (txtnum1.Text == "")
{
MessageBox.Show("Please Enter The Value Of Number 1");
txtnum1.Focus();
}
else if (txtnum2.Text == "")
{
MessageBox.Show("Please Enter The Value Of Number 2");
txtnum2.Focus();
}
else
{
if (rbtAdd.Checked)
{
result = Convert.ToInt32(txtnum1.Text) + Convert.ToInt32(txtnum2.Text);
MessageBox.Show("The Result Of Adding is :"+result);
}
else if (rbtMultiply.Checked)
{
result = Convert.ToInt32(txtnum1.Text) * Convert.ToInt32(txtnum2.Text);
MessageBox.Show("The Result Of Multiplying is :" + result);
}
else if (rbtSubtract.Checked)
{
result = Convert.ToInt32(txtnum1.Text) - Convert.ToInt32(txtnum2.Text);
MessageBox.Show("The Result Of Subtract is :" + result);
}
else
{
MessageBox.Show("Please Select any of the Methods Of Calculation");
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote