viernes, 16 de octubre de 2009

PRACTICA 6.2B

FLUJO
CONSOLA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_6._2B_console
{
class Program
{
static void Main(string[] args)
{
double t, y;
Console.WriteLine("\t\tfuncion matematica");
Console.WriteLine("\nvalor de t \t\tvalor de y");
for (t = 5; t <= 10; t = t + 0.5) { y = 2*Math.Exp(0.8 * t); Console.WriteLine("{0} \t\t\t{1} ", t, y); } Console.ReadLine(); } } }


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_6._2B_WINDOWS
{
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 \tVALOR 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 button3_Click(object sender, EventArgs e) { listBox1.Items.Clear(); } private void button2_Click(object sender, EventArgs e) { Close(); } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { } }

No hay comentarios:

Publicar un comentario