jueves, 12 de noviembre de 2009

Practica 10.3 Visual



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PRACTICA_10_3_W
{
public partial class Form1 : Form
{
double[,] voltajes = new double[3, 6];
int C1, C2;
int R, C;

public Form1()
{
InitializeComponent();
C1 = C2 = 0;
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
if (R < 3)
{
if (C < 5)
{
voltajes[R, C] = double.Parse(V.Text);
listBox1.Items.Add("Voltaje[" + R.ToString() + "," + C.ToString() + "]:" + voltajes[R, C].ToString());
C++;
V.Clear();
V.Focus();
}
else
{
R++;
C = 0;
}
}


}

private void button2_Click(object sender, EventArgs e)
{
for (R = 0; R < 3; R++)
{
for (C = 0; C < 5; C++)
{
if (voltajes[R, C] < 60)
{
C1 = C1 + 1;
}
else
{
if (voltajes[R, C] >= 60)
{
C2 = C2 + 1;
}
}
}
}
MessageBox.Show("Voltajes <>= 60 : " + C2);
}

private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
V.Clear();

}

private void button4_Click(object sender, EventArgs e)
{
Close();
}

}
}

No hay comentarios:

Publicar un comentario