12,886,892 members (36,981 online)
Rate this:
See more:
the meaning of this code
private void result_Click(object sender, EventArgs e)
{
double firstnumber = Convert.ToDouble(txtFirst.Text);
double secondnumber = Convert.ToDouble(txtSecond.Text);

if (rdbAddition.Checked == false && rdbSubtraction.Checked == false && rdbMultiplication.Checked == false && rdbDivision.Checked == false)
MessageBox.Show("Please Select Operation Before Calculator", "Message Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);

{
}
else if (rdbSubtraction.Checked)
{
}
else if (rdbMultiplication.Checked)
{
}
else if (rdbDivision.Checked)
{
}
Posted 15-Nov-12 1:54am
Ma lavy301

Rate this:

## Solution 1

It means you have to pick up a beginners book on C# and work through it.

All this does is take two numbers that are entered in textboxes, check a few checkboxes to figure out what to do with them and perform the requested operation on those two numbers, storing the result in another textbox.

Really, this is bad code for a simple calculator.
Rate this:

## Solution 2

This looks like a simple calculator app in WinForms.

It seems to take two numbers - firstnumber and secondnumber (stored as text in two TextBox controls); apply the appropriate arithmetic operation on them (determined by the state of a bunch of RadioButton controls) and store the result in a third TextBox.

That's pretty much it.
Rate this:

## Solution 3

The meaning of this bunch of code is like this.

There are 2 TextBox accepting numbers, and 4 checkbox/radio button for addition, subtraction, multiplication and division.

First you enter some numbers then, this code checks if any of the check box is clicked or not, if no, then show a message "Please Select Operation Before Calculator", and if yes then it does the functionality of addition, subtraction, multiplication, or division accordingly.

Hope you understand this code block now.

Thanks
Tapan kumar

Top Experts
Last 24hrsThis month
 CHill60 270 OriginalGriff 250 Jochen Arndt 180 ppolymorphe 140 Maciej Los 130
 OriginalGriff 4,307 CHill60 2,778 Karthik Bangalore 2,436 Jochen Arndt 2,308 ppolymorphe 1,985