Advertisement
Ecchijpbp

Programacion 2-2

Apr 13th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace AlumnoA
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void Form1_Load(object sender, EventArgs e)
  21. {
  22.  
  23. }
  24. private void btnCalcular_Click(object sender, EventArgs e)
  25. {
  26. Alumno a;
  27. a = new Alumno();
  28. a.pLegajo = Convert.ToInt32(txtLegajo.Text);
  29. a.pNombre = txtNombre.Text;
  30. a.pApellido = txtApellido.Text;
  31. a.pDocumento = Convert.ToInt32(txtDocumento.Text);
  32. a.pTipoDocumento = Convert.ToInt32(txtTipoDocum.Text);
  33. if (rbMasculino.Checked)
  34. {
  35. a.pSexo = true;
  36. }
  37. else
  38. {
  39. a.pSexo = false;
  40. }
  41. a.pFechaNacimiento = dtpFN.Value;
  42. a.pNota1 = Convert.ToDouble(txtNota1.Text);
  43. a.pNota2 = Convert.ToDouble(txtNota2.Text);
  44. a.pNota3 = Convert.ToDouble(txtNota3.Text);
  45. lblResultado.Text = a.calcularPromedio().ToString();
  46. if (a.calcularPromedio() >= 6)
  47. lblEstado.Text = "Aprobado";
  48. else
  49. lblEstado.Text = "Libre";
  50. txttoString.Clear();//Esto debe realizarse con el mismo objeto de la clase, es decir la clase o la creo como objeto global en el form, o lo hago en el mismo boton
  51. txttoString.Text = a.toString();
  52. }
  53.  
  54. private void button1_Click(object sender, EventArgs e)
  55. {
  56.  
  57. }
  58.  
  59.  
  60.  
  61.  
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement