using System;
using System.Collections.Generic;
using System.Text;
namespace Practica13
{
class Program
{
static void Main(string[] args)
{
Arreglo A1 = new Arreglo(5);
int I, dato;
for (I = 0; I <>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Practica13v
{
public partial class Calcular : Form
{
double[] dato ;
double may, men,suma, promedio;
int I;
public Calcular()
{
InitializeComponent();
dato = new double [5];
I = 0;
}
private void tdato_Click(object sender, EventArgs e)
{
if (I <>
using System.Collections.Generic;
using System.Text;
namespace Practica13
{
class Program
{
static void Main(string[] args)
{
Arreglo A1 = new Arreglo(5);
int I, dato;
for (I = 0; I <>
{
Console.Write("Introduce dato {0}:",(I + 1));
dato = int.Parse(Console.ReadLine()); A1.insertardato(I, dato); }
Console.WriteLine("\nLa suma es: {0}",A1.sumadatos(5));
Console.WriteLine("El dato mayor es: {0}", A1.mayor(5));
Console.WriteLine("El dato menor es: {0}", A1.menor(5));
Console.WriteLine("El promedio es: {0} ", A1.promedio(5));
Console.WriteLine("El promedio es: {0} ", A1.promedio(5));
Console.ReadLine(); } } }
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Practica13v
{
public partial class Calcular : Form
{
double[] dato ;
double may, men,suma, promedio;
int I;
public Calcular()
{
InitializeComponent();
dato = new double [5];
I = 0;
}
private void tdato_Click(object sender, EventArgs e)
{
if (I <>
suma = suma + dato[I];
promedio = suma / 5;
tbd.Clear(); I++;
if (I == 5) { tbd.Enabled = false;
} } }
private void button1_Click(object sender, EventArgs e)
{ may = dato[0];
for (I = 0; I <> may)
{ may = dato[I]; }
}
men = dato[0];
for (I = 0; I <>
{ may = dato[I]; }
}
men = dato[0];
for (I = 0; I <>
{ if ( dato[I]< men =" dato[I];">
} } label2.Text = ("La suma es: " + suma.ToString());
label3.Text = ("El dato mayor es: " + may.ToString());
label4.Text = ("El dato menor es: " + men.ToString());
label5.Text = ("El promedio es: " + promedio.ToString());
} private void Limpiar_Click(object sender, EventArgs e)
{ tbd.Clear(); tbd.Enabled = true;
label2.Text = ""; label3.Text = "";
label4.Text = ""; label5.Text = "";
} } }
No hay comentarios:
Publicar un comentario