Practica 1 en visual
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void cmdcaptura_Click(object sender, EventArgs e)
{
float[] calif = new float[10];
float P, Suma = 0;
int R = 0;
frmSegunda FormaCaptura = new frmSegunda();
cmdcaptura.Enabled = false;
for (R = 0; R < 10; R++)
{
if (FormaCaptura.ShowDialog() == DialogResult.OK)
{
calif[R] = System.Single.Parse(FormaCaptura.txtcalif.Text);
}
Suma = Suma + calif[R];
}
P = Suma / 10;
txtPg.Text = P.ToString();
for (R = 0; R < 10; R++)
{
if (P <= calif[R])
{
txtcalifi.Text = txtcalifi.Text + calif[R] + "\r\n".ToString();
}
}
}
private void cmdOtro_Click(object sender, EventArgs e)
{
txtcalifi.Clear();
txtPg.Clear();
cmdcaptura.Enabled = true;
}
private void cmdsalida_Click(object sender, EventArgs e)
{
Close();
}
}
}
No hay comentarios:
Publicar un comentario