PRACTICA 6 VALOR DE X, Y DE 1 A 5 CON INCREMENTOS DE .1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_6_consola
{
class Program
{
static void Main(string[] args)
{
double X, Y;
Console.WriteLine("FUNCION MATEMATICA");
Console.WriteLine("VALOR X VALOR Y");
for (X = 1; X <= 5; X = X + 0.1) { Y = 1.0 + X + Math.Pow(X, 5)/2.0 + Math.Pow(X, 3)/6.0 + Math.Pow (X,4)/24; Console.WriteLine("{0} {1}", X, Y); Console.ReadKey(); } } } }
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 FUNC_MATEMATICA_PRAC6_VISUAL
{
public partial class Form1 : Form
{
double X,Y;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double X, Y;
listBox1.Items.Add("-----VALOR DE X \t\t VALOR DE Y----");
for (X = 1; X <= 5; X = X + 0.1)
{
Y = 1 + X + Math.Pow(X, 2) / 2.0 + Math.Pow(X, 3) / 6.0 + Math.Pow(X, 4) / 24.0;
listBox1.Items.Add(X.ToString() + " \t\t " + Y.ToString());
}
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
jueves, 15 de octubre de 2009
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario