private void btnCalcular_Click(object sender, EventArgs e)
 {
     try
     {
         double Nota1 = Convert.ToDouble(txtExa1.Text), Nota2 = Convert.ToDouble(txtExa2.Text), Nota3 = Convert.ToDouble(txtExa3.Text), Prom;
         if (((Nota1 >= 0 && Nota1 <= 10) && (Nota2 >= 0 && Nota2 <= 10)) && (Nota3 >= 0 && Nota3 <= 10))
         {
             Prom         = (Nota1 + Nota2 + Nota3) / 3;
             txtProm.Text = Prom.ToString("N2");
         }
         else
         {
             MessageBox.Show("Revise que las calificaciones que ha ingresado estan en el rango indicado (0 - 10)", "Datos invalidos", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Para el funcionamiento de la aplicación ingrese solo números", "Datos invalidos", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
 private void _read()
 {
     _instRom = m_io.ReadBytes(8192);
     _prom    = new Prom(m_io, this, m_root);
 }