private void BtnCancelar_Click(object sender, EventArgs e) { TxtN1.Clear(); TxtN2.Clear(); TxtRest.Clear(); TxtN1.Focus(); }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtN1.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN1.Focus(); return; } if (TxtN2.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN2.Focus(); return; } if (TxtN3.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN3.Focus(); return; } double n1, n2, n3, rest; n1 = Convert.ToDouble(TxtN1.Text); n2 = Convert.ToDouble(TxtN2.Text); n3 = Convert.ToDouble(TxtN3.Text); rest = n1 + n2 + n3; TxtRest.Text = rest.ToString(); }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtN1.Text.Trim().Length == 0) { MessageBox.Show("Ingres calificacion 1"); TxtN1.Focus(); return; } if (TxtN2.Text.Trim().Length == 0) { MessageBox.Show("Ingres calificacion 1"); TxtN2.Focus(); return; } double n1, n2; n1 = Convert.ToDouble(TxtN1.Text); n2 = Convert.ToDouble(TxtN2.Text); if (n1 < n2) { TxtRest.Text = TxtRest.Text + n1; } else { TxtRest.Text = TxtRest.Text + n2; } }
private void BtnLimpiar_Click(object sender, EventArgs e) { TxtN1.Clear(); TxtN2.Clear(); TxtN3.Clear(); TxtN4.Clear(); TxtProm.Clear(); TxtN1.Focus(); }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtN1.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN1.Focus(); return; } int i, n; n = Convert.ToInt32(TxtN1.Text.Trim()); for (i = 0; i <= 60; i++) { TxtRest.Text = TxtRest.Text + i * n + " "; } }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtN1.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN1.Focus(); return; } if (TxtN2.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN2.Focus(); return; } if (TxtN3.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN3.Focus(); return; } if (TxtN4.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN4.Focus(); return; } double n1, n2, n3, n4, prom; n1 = Convert.ToDouble(TxtN1.Text); n2 = Convert.ToDouble(TxtN2.Text); n3 = Convert.ToDouble(TxtN3.Text); n4 = Convert.ToDouble(TxtN4.Text); prom = (n1 + n2 + n3 + n4) / 4; TxtProm.Text = prom.ToString(); }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtN1.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN1.Focus(); return; } double n1; n1 = Convert.ToDouble(TxtN1.Text); if (n1 >= 0) { TxtRest.Text = TxtRest.Text + "El numero es positivo"; } else { TxtRest.Text = TxtRest.Text + "El numero es negativo"; } }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtN1.Text.Trim().Length == 0) { MessageBox.Show("Ingrese un dato"); TxtN1.Focus(); return; } double n1, rest; n1 = Convert.ToDouble(TxtN1.Text.Trim()); if (n1 >= 10) { rest = n1 * n1; TxtRest.Text = TxtRest.Text + rest; } else { rest = n1 * n1 * n1; TxtRest.Text = TxtRest.Text + rest; } }