jueves, 15 de octubre de 2009

PRACTICA 5.4

speudicodigo

double x, y;

print"funcion matematica");

print"nvalor de x valor de y";

for (x = 1 to x <= 5 step x = x + 0.1)

{

y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4)/24.0;

print("{0} {1} ", x, y);

}

fin



CONSOLA

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace practica_6._4_console

{ class Program

{

static void Main(string[] args)

{

double x, y;

Console.WriteLine("\t\tfuncion matematica");

Console.WriteLine("\nvalor de x t\t\tvalor de y");

for (x = 1; x <= 5; x = x + 0.1)

{

y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4)/24.0;

Console.WriteLine("{0} \t\t\t{1} ", x, y);

}

Console.ReadLine();

}

}

}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_5._4_console
{
class Program
{
static void Main(string[] args)
{
double t, rad, x, y;
t = 0;
rad = Math.PI * 22.8 / 180;
Console.WriteLine("\ntiempo \tvalor de x \t\tvalor de y");
while(t<10) x =" 500" y =" 500" t =" t">

WINDOWS
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_5._4_windows
{
public partial class Form1 : Form
{
double T, RAD, X, Y;
public Form1()
{
T = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double T, RAD, X, Y;
T = 0;
RAD = Math.PI * 22.8 / 180;
listBox1.Items.Add("TIEMPO \tVALOR DE X \t\tVALOR DE Y");
do
{
X = 500 * T * Math.Cos(RAD);
Y = 500 * T * Math.Sin(RAD);
listBox1.Items.Add(T.ToString() + "\t" + X.ToString() + "\t\t" + Y.ToString());
T=T+ 1.0/2.0;
}
while(T<=10);
}
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)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}

No hay comentarios:

Publicar un comentario