20091110

PRACTICA 6.2 ECUACIONES MATEMATICAS(visual)








A)




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 x = 0.0, y;
for (x = 1; x <= 5; x = x + 1.0 / 10.0) { y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4) / 24;

listBox1.Items.Add(x + " 1.0 + x + x^2/2.0 + x^3/6.0 + x^4/24 = " + y); } } private void button2_Click(object sender, EventArgs e)

{ listBox1.Items.Clear();

} private void button3_Click(object sender, EventArgs e)

{ Close();

} private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { } } }



B)






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 x = 0.0, y;
for (x = 1; x <= 5; x = x + 1.0 / 10.0) { y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x,4) /24 ;

listBox1.Items.Add(x + "\t 1.0 + x + x^2/2.0 + x^3/6.0 + x^4/24 = " + y);

}

}

private void button2_Click(object sender, EventArgs e)

{ listBox1.Items.Clear();

}

private void button3_Click(object sender, EventArgs e)

{Close();

} private void listBox1_SelectedIndexChanged(object sender, EventArgs e)

{

} } }


C)




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 t = 0.0, y;
for (t = 5; t <= 10; t = t + 0.5)
{
y = 2 * Math.Exp(0.8 * t);
listBox1.Items.Add(t + "\t 2e^(0.8*t) " + y);
}

}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}

PRACTICA 6.2 EJERCICIO DE ECUACIONES (consola)

pseudocodigo.
Inicio
Real x,y
Print"funcion Matematica"
Print "valores x valores y "
for(x=2 to 10) step 0.2
{
y= 3* x ^5 + 2 * x ^3 + x
Print (x y )
}
fin

para las demas cuestiones del programa se cambia el print de las ecuaciones.

A)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
{
double x = 0.0, y;
for (x = 1; x <= 10; x = x + 2.0 / 10.0) { y = 3 * Math.Pow(x, 5) + 2 * Math.Pow(x, 3) + x; Console.WriteLine(x + " 3x^5 + 2x ^3 + x = " + y);

}
Console.ReadLine();
}
}
} }







B)




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double x = 0.0, y;
for (x = 1; x <= 5; x = x + 1.0 / 10.0)

{
y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4) / 24; Console.WriteLine(x + " 1.0 + x + x^2/2.0 + x^3/6.0 + x^4/24 = " + y);
Console.ReadKey();
} } } }







c)







using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
{
double t = 0.0, y;
for (t = 5; t <= 10; t = t + 0.5) { y = 2 * Math.Exp( 0.8 * t); Console.WriteLine(t + "\t 2e^ (0.8*t) " + y); } Console.ReadLine(); } } } }

PRACTICA 6.1 SUMA DE NUMEROS IMPARES( 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 N, I, S = 0.0;
N = double.Parse(textBox1.Text);
for (I = 1; I <= N; I = I + 2)
{
S = S + I;
}
textBox2.Text=(S.ToString());
textBox3.Text = N.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}

}
}

PRACTICA 6.1 SUMA DE NUMEROS IMPARES(consola)

pseudocodigo.
inicio
double N, I, S = 0.0;
print"Introduce un numero:"
read N
for (I = 1 to 2 step I = I + 2)
{
S = S + I
}
print "la suma de los numeros impares es ",S
} fin

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double N, I, S = 0.0;
Console.WriteLine("Introduce un numero:");
N = double.Parse(Console.ReadLine());
for (I = 1; I <= N; I = I + 2)
{
S = S + I;
}
Console.WriteLine("La suma de sus numeros impares es {0}", S);
Console.ReadKey();
}
}
}

PRACTICA 10.1ARREGLO LLAMADO PENDIENTES (consola,visual)

pseudocodigo.
inicio
double[] pendiente = 17.24, 26.63, 5.94, 33.92, 3.71, 32.84, 35.93, 18.24, 6.92
double mayor = 0, menor = 0
read I = 0
mayor = pendiente[0]
menor = pendiente[0]
for (I = 1; I < menor =" pendiente[I]" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTbNI3UipPZ8X4vpN0RE7vOqatsY_C5cdph-ssTEvi79ti9OeBdBIPUbKkbs4EWMFAC35813z0nbpM-cTSqAYdvAYThg7CgXPix9vR-ch_MxvjWKAS38v0cxIqi7FH1jb9cEUZNyHkXY1p/s1600-h/10.1c.bmp">Añadir imagen




Escriba un programa que almacene los siguientes valores en un arreglo llamado pendientes: 17.24,25.63,5.94,33.92,3.71,32.84,35.93,18.24,6.92. el programa debe localizar los valores maximos y minimos del arreglo.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)

{
double[] pendiente = { 17.24, 26.63, 5.94, 33.92, 3.71, 32.84, 35.93, 18.24, 6.92 };
double mayor = 0, menor = 0;
int I = 0;

mayor = pendiente[0];
menor = pendiente[0];
for (I = 1; I <> mayor)

{
mayor = pendiente[I];
}
}
for (I = 0; I <>
{
if (pendiente[I] < menor =" pendiente[I];">
} }
Console.WriteLine("el valor maximo es {0}: ", mayor);
Console.WriteLine("el valor minimo es
{0}: ", menor);
Console.ReadLine(); } } }

ARREGLO LLAMADO PENDIENTES (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[] pendiente = { 17.24, 25.63, 5.94, 33.92, 3.71,35.93, 18.24, 6.92,32.1 };
double mayor = pendiente[0];
double menor = pendiente[0];
int i;
listBox1.Items.Add("Pendientes:");

for (i = 0; i <= 8; i = i + 1) { listBox1.Items.Add(pendiente[i]); if (pendiente[i] > mayor)
{
mayor = pendiente[i];
}
if (pendiente[i] < menor =" pendiente[i];" text =" (" text =" (">

20091109

PRACTICA 8.3 ARREGLOS UNIDIMENSIONALES (visual)


A continuacion el ejecutble del programa dearreglos unidimensionale.

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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
int[] corriente;
int[] resistencia;
int[] voltios;
int I;
public Form1()
{
InitializeComponent();
corriente = new int[10];
resistencia = new int[10];
voltios = new int[10];
I = 0;
}
private void button1_Click(object sender, EventArgs e)
{
if (I <= 10)
{
textBox1.Focus();
corriente[I] = int.Parse(textBox1.Text);

resistencia[I] = int.Parse(textBox2.Text);
voltios[I] = corriente[I] * resistencia[I];
I++;
textBox2.Clear();
textBox1.Clear();
}
else
{
button1.Enabled = false;
}
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Add("Corriente Resistencia Voltios");
for (I = 0; I < 10; I++)
{
listBox1.Items.Add(corriente[I].ToString() + "\t\t" + resistencia[I].ToString() + "\t\t" + voltios[I].ToString());
}
}
private void button3_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
}
}

PRACTICA 8.3 ARREGLOS UNIDIMENSIONALES (consola)

pseudocodigo.
int[] corriente
int[] resistencia
int[] voltios
int I
corriente = new int[10]
resistencia = new int[10]
voltios = new int[10]
I = 0; for (I = 0 to I++)
{
print("IINTRODUCE VALOR DE LA CORRIENTE"
Read corriente[I]
print"IINTRODUCE VALOR DE LA RESISTENCIA"
Read resistencia[I]
voltios[I] = corriente[I] * resistencia[I]
}
print"CORRIENTE RESISTENCIA VOLTIOS "
for (I = 0 to I++)
{
print"", corriente[I], resistencia[I], voltios[I]
{
fin













Escriba un programa que especifique tres arreglos unidemensionales denominados corriente, resistencias y voltios. Cada arreglo debe ser capaz de almacenar diez elementos. Empleando una gaza for, introduzca valores para los arreglos resistencia, los datos introducidos en ela rreglo voltios deben deben ser el producto de los valores correspondientes a los arreglos corriente y resistencia(vlotis[i]=corriente[i]*resistencia[i]). Despues de introdicir los datos , despligue la siguiente salida: corriente, reisistencia, voltios. Despliegue el valor correcto despues de cada encabezado.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int[] corriente;
int[] resistencia;
int[] voltios;
int I;

corriente = new int[10];
resistencia = new int[10];
voltios = new int[10];
I = 0;

for (I = 0; I < i =" I">
{
Console.WriteLine("\tIINTRODUCE VALOR DE LA CORRIENTE");
corriente[I] = int.Parse(Console.ReadLine());
Console.WriteLine("\tIINTRODUCE VALOR DE LA RESISTENCIA");
resistencia[I] = int.Parse(Console.ReadLine());
voltios[I] = corriente[I] * resistencia[I];
}
Console.WriteLine("\tCORRIENTE RESISTENCIA VOLTIOS "); for (I = 0; I <>
{
Console.WriteLine("\t{0}\t\t{1}\t\t{2}", corriente[I], resistencia[I], voltios[I]);
} Console.ReadKey(); } } }