martes, 8 de diciembre de 2009
practicas extra unidad 3
CONSOLA
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double[] valor = { 5, 7, 8, 2, 3 };
int i;
double maximo = valor[0];
double minimo = valor[0];
double intervalo = 0;
for (i = 0; i <> maximo)
{
maximo = valor[i];
}
if (valor[i] < minimo =" valor[i];" intervalo="maximo-minimo;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZYrm6_QEFeEYy5XzQ8GFbHP0nYXF3YWeENH75ARRqqQ8crau_pmj-WOwQp4zKi02c4P2h8Xm0H8JbI6D2ZNfHna-fXRLksl4gfiBPkZONtKlvEzo5vOkUmdwEmkYMzJ1uQ8qqRqTjXQGz/s1600-h/med+cuad+visual+2.jpg">CONSOLA SEGUNDO PROBLEMA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EXAMEN2doCONSOLA
{
class Program
{
static void Main(string[] args)
{
int[] valor = new int[5];
int i = 0;
double mgeo = 0;
double total = 0;
Console.WriteLine("introduce los siguientes datos");
for (i = 0; i < total =" Math.Pow(valor[i]," mgeo =" Math.Sqrt(10" i =" 0;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZYrm6_QEFeEYy5XzQ8GFbHP0nYXF3YWeENH75ARRqqQ8crau_pmj-WOwQp4zKi02c4P2h8Xm0H8JbI6D2ZNfHna-fXRLksl4gfiBPkZONtKlvEzo5vOkUmdwEmkYMzJ1uQ8qqRqTjXQGz/s1600-h/med+cuad+visual+2.jpg">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 media_geometrica
{
public partial class Form1 : Form
{
int[] x = new int[10];
double multip = 0, GM;
int i = 0;
public Form1()
{
multip = GM = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (i< 10)
{
x[i] = int.Parse(textBox1.Text);
listBox1.Items.Add(x[i]);
textBox1.Clear();
textBox1.Focus();
i++;
}
}
private void button2_Click(object sender, EventArgs e)
{
for (i = 0; i <5; i++)
{
listBox1.Items.Add("dato" + i.ToString() + ": " + x[i].ToString());
multip = Math.Pow(x[i], 5);
}
GM = Math.Sqrt(5 / multip);
listBox1.Items.Add("El valor cuadratico medio es" + GM.ToString());
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario