lunes, 22 de febrero de 2010

practica 5


Practica 5_1 visual


sing 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
{
double ga;
double mi;
double rendimiento;
public Form1()
{
InitializeComponent();
ga = mi = rendimiento=0;
}

private void button1_Click(object sender, EventArgs e)
{
mi = double.Parse(textBox1.Text);
ga = double.Parse(textBox2.Text);
rendimiento = mi / ga;
label3.Text = "rendimiento millas por galon = " + rendimiento;
}
}
}

Practica 5_1 consola

using System;
using System.Collections.Generic;

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

Console.WriteLine("Introduzca las millas recorridas: ");

double millas = Double.Parse(Console.ReadLine());
Console.WriteLine("\nIntroduzca los galones de gasolina consumidos");
double galones = double.Parse(Console.ReadLine());
double rendimiento = millas/galones;
Console.WriteLine ("la cantida consumida millas por galon es = {0:f4}", rendimiento); Console.ReadKey();
}
}
}


Practica 5_2 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
{
double r, a, b, c, x;
public Form1()
{
InitializeComponent();
r = a = b = c = x = 0;
}
private void button1_Click(object sender, EventArgs e)
{
a = double.Parse(textBox1.Text);
b = double.Parse(textBox2.Text);
c = double.Parse(textBox3.Text);
x = double.Parse(textBox4.Text);
r = a * Math.Pow(x, 2) + b * x + c;
label5.Text = "el resultado del polinomio es " + r;
}
private void button2_Click(object sender, EventArgs e)
{

textBox1.Clear();

textBox2.Clear();
textBox3.Clear();

textBox4.Clear();
textBox1.Focus();
}
}

}

Practica 5_2 consola

using System;
using System.Collections.Generic;

using System.Linq; using System.Text;
namespace ConsoleApplication1
{
class Program

{

static void Main(string[] args)
{
Console.WriteLine("Programa que calcula el valor de polinomio de segundo orden");
Console.WriteLine("introduce el valor de A"); double a = double.Parse(Console.ReadLine()); Console.WriteLine("introduce el valor de B"); double b = double.Parse(Console.ReadLine()); Console.WriteLine("introduce el valor de C"); double c = double.Parse(Console.ReadLine()); Console.WriteLine("introduce el valor de X "); double x = double.Parse(Console.ReadLine()); double resultado = a*Math.Pow(x,2) + b*x + c;
Console.WriteLine(" el valor del polinomio es = " + resultado);
Console.ReadKey();

}
}
}


Practica 5_3 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
{
double angulo;
public Form1()
{
InitializeComponent();
angulo = 0;
}

private void button1_Click(object sender, EventArgs e)
{
angulo = double.Parse(textBox1.Text);
if (angulo < text="angulo agudo" angulo ="=" text="angulo recto" text="angulo obtuso " text = " ">

practica 5_3 consola

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine("Introduce el angulo"); double angulo = double.Parse(Console.ReadLine()); if (angulo <> { Console.WriteLine("angulo agudo"); } else { if (angulo == 90) { Console.WriteLine("angulo recto"); } else { Console.WriteLine("angulo obtuso "); } } Console.ReadKey(); } } }



Practica 5_4 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
{
double c1,c2,c3,c4,c5, promedio;
string nombre;
public Form1()
{
InitializeComponent();
c1 = c2 = c3 = c4 = c5 = promedio = 0;
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
nombre= textBox1.Text;
c1 = double.Parse(textBox2.Text);
c2 = double.Parse(textBox3.Text);
c3 = double.Parse(textBox4.Text);
c4 = double.Parse(textBox5.Text);
c5 = double.Parse(textBox6.Text);
promedio = (c1 + c2 + c3 + c4 + c5) / 5;
if (promedio >= 70)
{
label7.Text = "alumno aprobado " + nombre + "promedio " + promedio;
}
else
{
label7.Text = "alumno no acreditado " + nombre + " promedio " + promedio;
}


}

private void button2_Click(object sender, EventArgs e)
{

}
}
}


Practica 5_4 consola


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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Introduce nombre del alumno");
string nombre = Console.ReadLine();
Console.WriteLine("Introduce calficacion 1");
double c1 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce calficacion 2");
double c2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce calficacion 3");
double c3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce calficacion 4");
double c4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce calficacion 5");
double c5 = double.Parse(Console.ReadLine());
double promedio = (c1 + c2 + c3 + c4 + c5) / 5;
if (promedio >= 70)
{
Console.WriteLine("alumno aprobado " + nombre + " Promedio {0:f4} " , promedio);
}
else
{
Console.WriteLine("alumno no acreditado " + nombre + " Promedio {0:f4} " , promedio);
}

Console.ReadKey();

}
}
}

practica 5_5






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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int n1, n2, n3, n4, n5, mayor = 0;
Console.Write("introduce numero 1:");
n1 = int.Parse(Console.ReadLine());
Console.Write("introduce numero 2:");
n2 = int.Parse(Console.ReadLine());
Console.Write("introduce numero 3:");
n3 = int.Parse(Console.ReadLine());
Console.Write("introduce numero 4:");
n4 = int.Parse(Console.ReadLine());
Console.Write("introduce numero 5:");
n5 = int.Parse(Console.ReadLine());
if (n1 >= n2 && n1 >= n3 && n1 >= n4 && n1 >= n5)
{
mayor = n1;
}
else
{
if (n2 >= n1 && n2 >= n3 && n2 >= n4 && n2 >= n5)
{
mayor = n2;
}
else
{
if (n3 >= n1 && n3 >= n2 && n3 >= n4 && n3 >= n5)
{
mayor = n3;
}
else
{
if (n4 >= n1 && n4 >= n2 && n4 >= n3 && n4 >= n5)
{
mayor = n4;
}
else
{
if (n5 >= n1 && n5 >= n2 && n5 >= n3 && n5 >= n4)
{
mayor = n5;
}
}
}
}
}
Console.WriteLine("el dato mayor es {0} ", mayor);
Console.ReadKey();
}
}
}





practica 5_5 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
{
int n1, n2, n3, n4, n5, mayor;
public Form1()
{
InitializeComponent();
n1 = n2 = n3 = n4 = n5 = mayor = 0;
}

private void button1_Click(object sender, EventArgs e)
{
n1 = int.Parse(textBox1.Text);
n2 = int.Parse(textBox2.Text);
n3 = int.Parse(textBox3.Text);
n4 = int.Parse(textBox4.Text);
n5 = int.Parse(textBox5.Text);
if (n1 >= n2 && n1 >= n3 && n1 >= n4 && n1 >= n5)
{
mayor = n1;
}
else
{
if (n2 >= n1 && n2 >= n3 && n2 >= n4 && n2 >= n5)
{
mayor = n2;
}
else
{
if (n3 >= n1 && n3 >= n2 && n3 >= n4 && n3 >= n5)
{
mayor = n3;
}
else
{
if (n4 >= n1 && n4 >= n2 && n4 >= n3 && n4 >= n5)
{
mayor = n4;
}
else
{
if (n5 >= n1 && n5 >= n2 && n5 >= n3 && n5 >= n4)
{
mayor = n5;
}
}
}
}
}
label6.Text = " el dato mayor " + mayor;
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
textBox1.Focus();
}
}
}

miércoles, 17 de febrero de 2010




Practica 4 problema 4










using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// progrma que calcula la distancia entre dos puntos
// Gamez Cardenas Enrique 09210799
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double x1, x2, y1, y2, distancia = 0;
Console.Write("introduce el valor x1: ");
x1 = double.Parse(Console.ReadLine());
Console.Write("introduce el valor y1: ");
y1 = double.Parse(Console.ReadLine());
Console.Write("introduce el valor x2: ");
x2 = double.Parse(Console.ReadLine());
Console.Write("introduce el valor y2: ");
y2 = double.Parse(Console.ReadLine());
distancia= Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));
Console.WriteLine("primer punto (" + x1 + "," + y1 + ")");
Console.WriteLine("segundo punto (" + x2 + "," + y2 + ")");
Console.WriteLine("la distancia = " + distancia);
Console.ReadLine();

}
}
}

lunes, 15 de febrero de 2010

practica 4 diagramas de flujo



practica 4 visual

Practica 4_1

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
{
double x1;
double x2;
double y1;
double distancia;

double y2;

public Form1()
{
InitializeComponent();
x1 = x2 = y1 = y2 = distancia = 0;
}

private void button1_Click(object sender, EventArgs e)
{
x1 = double.Parse(textBox1.Text);
y1 = double.Parse(textBox2.Text);
x2 = double.Parse(textBox3.Text);
y2 = double.Parse(textBox4.Text);
distancia = Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));


label5.Text= "la distancia es = " + distancia;

}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
label5.Text = " ";
}
}
}





Practica 4_2

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
{
double x, y, z, w, t1, t2, t3, t4 , f;

public Form1()
{
InitializeComponent();
x = y = z = w = t1=t2=t3=t4=f= 0;
}

private void label2_Click(object sender, EventArgs e)
{





}

private void button1_Click(object sender, EventArgs e)
{
x = double.Parse(textBox1.Text);
y = double.Parse(textBox2.Text);
z = double.Parse(textBox3.Text);
w = double.Parse(textBox4.Text);
t1 = (4 * Math.Pow(x, 2) * Math.Pow(y, 2));
t2 = Math.Sqrt(2 * z * w);
t3 = 4 * Math.Pow(x, 1.0 / 2.0);
t4 = t1 * t2;
f = Math.Pow(t4, 2) / t3;
label5.Text = "f = " + f;
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox1.Focus();

}
}
}





Practica 4_3

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
{
double z, w;
public Form1()
{
InitializeComponent();
z = w = 0;
}

private void button1_Click(object sender, EventArgs e)
{
w = double.Parse(textBox1.Text);
z= (1.0/Math.Sqrt(2*Math.PI)*Math.Exp(-w*w/2));
label1.Text = " z = " + z;


}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label1.Text = " ";
textBox1.Focus();
}
}
}






Practica 4 consola

Practica 4 problema 1


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// progrma que calcula la distancia entre dos puntos
// Gamez Cardenas Enrique 09210799
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double x1, x2, y1, y2, distancia = 0;
Console.Write("introduce el valor x1: ");
x1 = double.Parse(Console.ReadLine());
Console.Write("introduce el valor y1: ");
y1 = double.Parse(Console.ReadLine());
Console.Write("introduce el valor x2: ");
x2 = double.Parse(Console.ReadLine());
Console.Write("introduce el valor y2: ");
y2 = double.Parse(Console.ReadLine());
distancia= Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));
Console.WriteLine("primer punto (" + x1 + "," + y1 + ")");
Console.WriteLine("segundo punto (" + x2 + "," + y2 + ")");
Console.WriteLine("la distancia = " + distancia);
Console.ReadLine();

Practica 4 problema 2


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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("introduce el valor de x");
double x = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor de y");
double y = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor de z");
double z = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor de w");
double w = double.Parse(Console.ReadLine());
double t1 = (4*Math.Pow(x,2)*Math.Pow(y,2));
double t2 = Math.Sqrt(2*z*w);
double t3 = 4*Math.Pow(x,1.0/2.0);
double t4 = t1*t2;
double f = Math.Pow(t4,2)/t3;
Console.WriteLine("f = " + f);
Console.ReadKey();

Practica 4 Problema 3


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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Write("introduce valor w = ");
double w = double.Parse(Console.ReadLine());
double z = (1.0/Math.Sqrt(2*Math.PI) * Math.Exp(-w*w/2));
Console.WriteLine ("z = " + z);
Console.ReadKey();
}
}
}

lunes, 8 de febrero de 2010

practica 3 visual

practica 3 problema 1

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
{
double grados, radianes;
public Form1()
{


InitializeComponent();
grados = radianes = 0.0;
}

private void button1_Click(object sender, EventArgs e)
{
grados = double.Parse(textBox1.Text);
radianes = grados * 3.1416 / 180;
label2.Text = "grados = " + grados + " radianes=" + radianes;
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label2.Text = " ";
textBox1.Focus();
}


practica 3 problema 2 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
{
double lado, ancho, largo, lado1, lado2, lado3,radio, diametro, dma,dme,l;
public Form1()
{
InitializeComponent();
lado = ancho = largo = lado1 = lado2 = lado3 = radio = diametro=dma=dme=l = 0;
}

private void button1_Click(object sender, EventArgs e)
{
lado = double.Parse(textBox1.Text);
double a1 = lado * lado;
double p1 = 4 * lado;
label10.Text = "area = " + a1 + " perimetro= " + p1;

largo = double.Parse(textBox2.Text);

ancho = double.Parse(textBox3.Text);
double a2 = largo * ancho;
double p2 = (2 * largo) + (2 * ancho);
label11.Text = "area = " + a2 + " perimetro = " + p2;

lado1 = double.Parse(textBox4.Text);
lado2 = double.Parse(textBox5.Text);
lado3 = double.Parse(textBox6.Text);
double a3 = (lado1 * lado2) / 2;
double p3 = lado1 + lado2 + lado3;

label12.Text= "area = " + a3 + " perimetro = " + p3;
radio = double.Parse(textBox7.Text);
diametro = double.Parse(textBox8.Text);
double a4 = (radio * radio) * 3.1416;
double p4 = 3.1416 * diametro;
label16.Text = "area = " + a4 + " perimetro= " + p4;
dma = double.Parse(textBox9.Text);
dme = double.Parse(textBox10.Text);
l = double.Parse(textBox11.Text);
double a5= (dma * dme)/2;
double p5 = 4 * l;
label21.Text = "area = " + a5 + " perimetro= " + p5;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label2.Text = " ";

textBox1.Focus();

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

}
}
}





practica 3 problema 3

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
{
double radio;
double area;
double volumen;
public Form1()
{
InitializeComponent();
radio = 0;
area = 0;
volumen = 0;

}

private void button1_Click(object sender, EventArgs e)
{
radio = double.Parse(textBox1.Text);
area = (radio * radio) * 4 * 3.1416;
volumen = (radio * radio * radio) * 3.1416 * 4 / 3;
label3.Text = "area = " + area;
label4.Text = " volumen= " + volumen;

}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label3.Text = " ";
label4.Text = " ";
textBox1.Focus();

}
}
}

practica 3 problema 4

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
{
double x;
double y;
public Form1()
{
InitializeComponent();
x = y = 0;
}

private void button1_Click(object sender, EventArgs e)
{
x = double.Parse(textBox1.Text);
y = (3 * (x * x)) + 9 * x - 20;
label3.Text = "y = " + y;
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label3.Text = " ";
textBox1.Focus();

}
}
}

practica 3 problema 5 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
{
double horas;
double minutos;

double segundos;
double dias;
public Form1()
{
InitializeComponent();
horas= minutos = segundos =dias;
}

private void button1_Click(object sender, EventArgs e)
{
horas = double.Parse(textBox1.Text);
minutos = horas * 60;
segundos = minutos * 60;
dias = horas / 24;
label2.Text = "minutos= " + minutos;
label3.Text = "segundos = " + segundos;
label4.Text = " dias = " + dias;
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label2.Text = " ";
label3.Text = " ";
label4.Text = " ";
textBox1.Focus();
}
}
}

practica 3 problema 6 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
{
string des;
int numero;
float costoart;

public Form1()
{
InitializeComponent();
des = " ";
numero = 0;
costoart = 0.0f;

}

private void button1_Click(object sender, EventArgs e)
{
des = textBox1.Text;
numero = int.Parse(textBox2.Text);
costoart = numero * 3.5f + 10700.0f;
label3.Text = "costo producto del articulo " + des + " es" + costoart;
}
}
}

practica 3




practica 3


practica 3 prgrama 1




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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{

Console.WriteLine("introduce la cantidad en grados");
double grados =double.Parse( Console.ReadLine());
double radianes = grados * 3.1416 / 180;
Console.WriteLine("resultado grados = " + grados + " radianes = " + radianes);
Console.ReadKey();
Console.ReadKey();




}
}
}


PRACTICA 3 PROBLEMA 2


Practica 3 programa 2

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

namespace ConsoleApplication1
{

class Program

{
static void Main(string[] args)
{
Console.WriteLine("area y perimetro de un cuadrado");
Console.WriteLine("\nintroduce el valor del lado del cuadrado");
double lado = double.Parse(Console.ReadLine());

double area = lado* lado;
double perimetro = 4 * lado;

Console.WriteLine(" area del cuadro igual = " + area + " perimetro = " + perimetro);

Console.WriteLine("\narea y perimetro de un rectangulo");

Console.WriteLine("\nintroduce el valor del largo");
double largo = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor del ancho");
double ancho = double.Parse(Console.ReadLine());
double area2 = ancho * largo;
double perimetro2 = (2*ancho)+ (2*largo);

Console.WriteLine("rectangulo area = " + area2 + " perimetro= " + perimetro2);

Console.WriteLine("\narea y perimetro de un traingulo");

Console.WriteLine("\nintroduce el valor del lado 1");
double lado1 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor del lado 2");
double lado2 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor del lado 3");
double lado3 = double.Parse(Console.ReadLine());
double area3 = (lado1 * lado2) / 2;
double perimetro3 = lado1 + lado2 + lado3;
Console.WriteLine(" triangulo area = " + area3 + " perimetro= " + perimetro3);

Console.WriteLine("\ncirculo ");
Console.WriteLine("\nintroduce el valor del radio");
double radio = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor del diametro");
double diametro = double.Parse(Console.ReadLine());

double area4 = (radio * radio) * 3.1416;
double perimetro4 = diametro * 3.1416;
Console.WriteLine("circulo area = " + area4 + " perimetro= " + perimetro4);

Console.WriteLine("\nrombo");
Console.WriteLine("\nintroduce el valor de la diagonal mayor ");
double dma = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor de la diagonal menor");
double dme = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el valor del lado ");
double lado5 = double.Parse(Console.ReadLine());
double area5 = (dma * dme) / 2;
double perimetro5 = 4* lado5;
Console.WriteLine(" rombo area = " + area5 + " perimetro= " + perimetro5);


Console.ReadKey();
}
}
}

PRACTICA 3 PROBLEMA 3


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine(" esfera");

Console.WriteLine("\nintroduce el valor del radio");

double radio = double.Parse(Console.ReadLine());

double area = (radio*radio)*4*3.1416;

double volumen = (radio*radio*radio)*3.1416 * 4/3;

Console.WriteLine("\narea= " + area + "\tvolumen = " + volumen);

Console.ReadKey();

}

}

}


PRACTICA 3 PROBLEMA 4


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine(" y = 3x^2 + 9x - 20");

Console.WriteLine("\nintroduce un valor para la variable x");

double x = double.Parse(Console.ReadLine());

double y = (3*(x * x)) + 9 * x - 20;

Console.WriteLine("y = " + y);

Console.ReadKey();

}

}

}


PRACTICA 3 PROBLEMA 5

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine("introduce la cantidad en horas");

int horas = int.Parse(Console.ReadLine());

float minutos = horas * 60f;

float segundo = minutos * 60f;

double dias = horas / 24;

Console.WriteLine ("\nminutos= " + minutos);

Console.WriteLine("\nhoras= " + horas);

Console.WriteLine("\ndias= " + dias);

Console.ReadKey();

}

}

}





PRACTICA 3 PROBLEMA 6


Practica 3 problema 6

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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("descripcion articulo");
string des = Console.ReadLine();
Console.WriteLine("numero unidades producidas");
int numero = int.Parse(Console.ReadLine());
float costoArt = numero * 3.5f + 10700.0f;
Console.WriteLine("costo producto del articulo" + des + "es:" +costoArt );
Console.ReadKey();
Console.ReadKey();

}
}
}


jueves, 4 de febrero de 2010

Practica 2


PRACTICA 2


Practica 2 problema 1

Practica 2 problema 2




Practica 2 problema 3



practica 1


PRACTICA 1


Practica 1 Programa 1

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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("El conjunto de ecuaciones lineales de");
Console.WriteLine("\nA11X1 + A12X2=C1");
Console.WriteLine("\nA21X1 + A22X2=C2");
Console.WriteLine("\nSe puede solucionar utilizando la regla de cramer");
Console.WriteLine("\nX1-(C1A22-C2A12)/(A11A22-A12A21)");
Console.WriteLine("\nX2-(C2A11-C1A21)/(A11A22-A12A21)");
Console.ReadKey();

}
}
}



Practica 1 Problema 2


Practica 1 problema 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace practica_1_problema_2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("\tGrados\tRadianes");
Console.WriteLine("\n\t_______________");
Console.WriteLine("\t0\t0.000");
Console.WriteLine("\t90\t1.5708");
Console.WriteLine("\t180\t3.1416");
Console.WriteLine("\t270\t4.7124");
Console.WriteLine("\t360\t6.2832");
Console.WriteLine("\n\t_______________");
Console.ReadKey();


Practica 1 Problema 3


Practica 1 practica 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Gámez Cárdenas Enrique");
Console.WriteLine("\n23 de Febrero de 1991");
Console.WriteLine("\nItr Durango no. 2112 Fracc. Villas de Otay");
Console.WriteLine("\nTijuana Baja California codigo postal 22500");
Console.ReadKey();