jueves, 25 de marzo de 2010

practica 8

Practica 8_1
sing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double g, litros;
Console.WriteLine("Galones Litros");
for (g = 100; g <= 200; g = g + 10)
{
litros = g * 3.785;
Console.WriteLine("{0}\t\t{1}", g, litros);
}
Console.ReadKey();
}
}
}

Practica 8_1visual
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 practica8_problema_1_visual
{
public partial class Form1 : Form
{
double g, litros;
public Form1()
{
InitializeComponent();
listBox1.Items.Add("\tGalones\t\tLitros");
}

private void button1_Click(object sender, EventArgs e)
{
for (g = 100; g <= 200; g = g + 10) { litros = g * 3.785; listBox1.Items.Add("\t" + g + "\t\t" + litros); } } private void button2_Click(object sender, EventArgs e) { listBox1.Items.Clear(); listBox1.Items.Add("\tGalones\t\tLitros"); } private void button3_Click(object sender, EventArgs e) { Close(); } } }

Practica 8_1 pseudocodigo
1 Declarar variables
double g, litros;

Print "Galones Litros";
for g=100 to 200 step 10

litros = g * 3.785;
Print g, litros;

fin
Practica8_2
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int numero,numero2,numero3,numero4,numero5;
int contador, mayor, pos;

numero = contador = mayor = pos = 0;
Console.WriteLine("Introduce numero");



numero = int.Parse(Console.ReadLine());
Console.WriteLine("Introduce numero");



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

Console.WriteLine("Introduce numero");



numero3 = int.Parse(Console.ReadLine());
Console.WriteLine("Introduce numero");



numero4 = int.Parse(Console.ReadLine());
Console.WriteLine("Introduce numero");



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





if (contador <= 5) { if (numero > mayor)
{
mayor = numero;
pos = contador;
}
}
else{
if (numero > mayor)
{
mayor = numero;
pos = contador;
}
Console.WriteLine("el dato mayor : " + mayor);
Console.WriteLine("este es la posicion" + pos);
}
contador = contador + 1;



}
}
}

Practica 8_2visual
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 numero;
int contador, mayor, pos;
public Form1()
{
InitializeComponent();
numero = contador = mayor = pos = 0;
listBox1.Items.Add("Lista de numeros");
}

private void button1_Click(object sender, EventArgs e)
{
numero = int.Parse(textBox1.Text);
listBox1.Items.Add(numero);



if (contador <= 5) { if (numero > mayor)
{
mayor = numero;
pos = contador;
}
}
else{
if (numero > mayor)
{
mayor = numero;
pos = contador;
}
listBox1.Items.Add("el dato mayor : " + mayor);
listBox1.Items.Add("este es la posicion" + pos);
}
contador = contador + 1;


}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
listBox1.Items.Clear();
mayor = 0;
pos = 0;
contador = 1;
}

private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}

Practica 8_2 pseudocodigo
declarar variables
int numero,numero2,numero3,numero4,numero5;
int contador, mayor, pos;

numero = contador = mayor = pos = 0;
Print"Introduce numero";
read numero
contador=contador+1
Print"Introduce numero";
read numero
contador=contador+1
Print"Introduce numero";
read numero
contador=contador+1
Print"Introduce numero";
read numero
contador=contador+1
Print"Introduce numero";
read numero
contador=contador+1










if (contador <= 5) { if (numero > mayor)
{
mayor = numero;
pos = contador;
}
}
else{
if (numero > mayor)
{
mayor = numero;
pos = contador;
}
Print"el dato mayor : " + mayor;
Print"este es la posicion" + pos;
}



Practica 8_3
using System;

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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
;
double cph1, cph2, cph3, cph4, cph5, cph6, cph7;
double cdh1, cdh2, cdh3, cdh4, cdh5, cdh6, cdh7;
double cpg1, cpg2, cpg3, cpg4, cpg5, cpg6, cpg7;
double cdg1, cdg2, cdg3, cdg4, cdg5, cdg6, cdg7;
double cpt1, cpt2, cpt3, cpt4, cpt5, cpt6, cpt7;
double cdt1, cdt2, cdt3, cdt4, cdt5, cdt6, cdt7;


Console.WriteLine("Reporte de unidad de control de calidad de una linea");
Console.WriteLine("Planta Unidades Producidas Unidades defectuosas");
Console.WriteLine("Planta 1 Hermosillo " );
Console.WriteLine("Introduce la cantidad de unidades producida dia 1 ");
cph1 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 1");
cdh1 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 2 ");
cph2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 2");
cdh2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 3 ");
cph3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 3");
cdh3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 4 ");
cph4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 4");
cdh4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 5 ");
cph5 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 5");
cdh5 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 6 ");
cph6 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 6");
cdh6 = double.Parse(Console.ReadLine());

Console.WriteLine("Introduce la cantidad de unidades producida dia 7 ");
cph7 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 7");
cdh7 = double.Parse(Console.ReadLine());
double hupt = cph1 + cph2 + cph3 + cph4 + cph5 + cph6 + cph7;
double Hudt = cdh1 + cdh2 + cdh3 + cdh4 + cdh5 + cdh6 + cdh7;
double hpdt = (Hudt / hupt) * 100;
Console.WriteLine("porcentaje total de unidades defectuosos " + hpdt+"%");

Console.WriteLine("Planta 2 Guamuchil ");
Console.WriteLine("Introduce la cantidad de unidades producida dia 1 ");
cpg1 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 1");
cdg1 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 2 ");
cpg2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 2");
cdg2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 3 ");
cpg3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 3");
cdg3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 4 ");
cpg4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 4");
cdg4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 5 ");
cpg5 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 5");
cdg5 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 6 ");
cpg6 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 6");
cdg6 = double.Parse(Console.ReadLine());

Console.WriteLine("Introduce la cantidad de unidades producida dia 7 ");
cpg7 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 7");
cdg7 = double.Parse(Console.ReadLine());
double gupt = cpg1 + cpg2 + cpg3 + cpg4 + cpg5 + cpg6 + cpg7;
double gudt = cdg1 + cdg2 + cdg3 + cdg4 + cdg5 + cdg6 + cdg7;
double gpdt = (Hudt / hupt) * 100;
Console.WriteLine("porcentaje total de unidades defectuosos " + gpdt + "%");
Console.ReadKey();
Console.WriteLine("Planta 3 Tijuana ");
Console.WriteLine("Introduce la cantidad de unidades producida dia 1 ");
cpt1 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 1");
cdt1 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 2 ");
cpt2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 2");
cdt2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 3 ");
cpt3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 3");
cdt3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 4 ");
cpt4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 4");
cdt4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 5 ");
cpt5 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 5");
cdt5 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades producida dia 6 ");
cpt6 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 6");
cdt6 = double.Parse(Console.ReadLine());

Console.WriteLine("Introduce la cantidad de unidades producida dia 7 ");
cpt7 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce la cantidad de unidades defectuosas dia 7");
cdt7 = double.Parse(Console.ReadLine());
double tupt = cpt1 + cpt2 + cpt3 + cpt4 + cpt5 + cpt6 + cpt7;
double tudt = cdt1 + cdt2 + cdt3 + cdt4 + cdt5 + cdt6 + cdt7;
double tpdt = (Hudt / hupt) * 100;
Console.WriteLine("porcentaje total de unidades defectuosos " + tpdt + "%");
Console.ReadKey();







}
}
}
Practica 8_3visual
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
{

planta_H ph;
planta_g pg;
planta_t pt;
planta_c pc;
planta_m Pm;
public Form1()
{
InitializeComponent();
ph = new planta_H();
pg = new planta_g();
pt = new planta_t();
pc = new planta_c();
Pm = new planta_m();
}

private void btHermosillo_Click(object sender, EventArgs e)
{
ph.Show();
}

private void btGuamuchil_Click(object sender, EventArgs e)
{
pg.Show();
}

private void btTijuana_Click(object sender, EventArgs e)
{
pt.Show();
}

private void btculiacan_Click(object sender, EventArgs e)
{
pc.Show();
}

private void button1_Click(object sender, EventArgs e)
{
Pm.Show();
}
}
}

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 planta_c : Form
{
public double dp1, dp2, dp3, dp4, dp5, dp6, dp7, dd1, dd2, dd3, dd4, dd5, dd6, dd7, pd1, pd2, pd3, pd4, pd5, pd6, pd7, tph, tdh;
public planta_c()
{
InitializeComponent();
dp1 = dp2 = dp3 = dp4 = dp5 = dp6 = dp7 = dd1 = dd2 = dd3 = dd4 = dd5 = dd6 = dd7 = pd1 = pd2 = pd3 = pd4 = pd5 = pd6 = pd7 = tph = tdh = 0;
}

private void btplantah_Click(object sender, EventArgs e)
{
dp1 = double.Parse(txtbh.Text);
dd1 = double.Parse(txtbh2.Text);
dp2 = double.Parse(txtbh4.Text);
dd2 = double.Parse(txtbh5.Text);
dp3 = double.Parse(txtbh7.Text);
dd3 = double.Parse(txtbh8.Text);
dp4 = double.Parse(txtbh10.Text);
dd4 = double.Parse(txtbh11.Text);
dp5 = double.Parse(txtbh13.Text);
dd5 = double.Parse(txtbh14.Text);
dp6 = double.Parse(txtbh16.Text);
dd6 = double.Parse(txtbh17.Text);
dp7 = double.Parse(txtbh19.Text);
dd7 = double.Parse(txtbh20.Text);
pd1 = dd1 / dp1;
pd2 = dd2 / dp2;
pd3 = dd3 / dp3;
pd4 = dd4 / dp4;
pd5 = dd5 / dp5;
pd6 = dd6 / dp6;
pd7 = dd7 / dp7;
tph = pd1 + pd2 + pd3 + pd4 + pd5 + pd6 + pd7;
tdh = dd1 + dd2 + dd3 + dd4 + dd5 + dd6 + dd7;
txtbh3.Text = pd1.ToString();
txtbh6.Text = pd2.ToString();
txtbh9.Text = pd3.ToString();
txtbh12.Text = pd4.ToString();
txtbh15.Text = pd5.ToString();
txtbh18.Text = pd6.ToString();
txtbh21.Text = pd7.ToString();

}
}
}

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 planta_g : Form
{
public double dp1, dp2, dp3, dp4, dp5, dp6, dp7, dd1, dd2, dd3, dd4, dd5, dd6, dd7, pd1, pd2, pd3, pd4, pd5, pd6, pd7, tph, tdh;
public planta_g()
{
InitializeComponent();
dp1 = dp2 = dp3 = dp4 = dp5 = dp6 = dp7 = dd1 = dd2 = dd3 = dd4 = dd5 = dd6 = dd7 = pd1 = pd2 = pd3 = pd4 = pd5 = pd6 = pd7 = tph = tdh = 0;
}

private void btplantah_Click(object sender, EventArgs e)
{
dp1 = double.Parse(txtbh.Text);
dd1 = double.Parse(txtbh2.Text);
dp2 = double.Parse(txtbh4.Text);
dd2 = double.Parse(txtbh5.Text);
dp3 = double.Parse(txtbh7.Text);
dd3 = double.Parse(txtbh8.Text);
dp4 = double.Parse(txtbh10.Text);
dd4 = double.Parse(txtbh11.Text);
dp5 = double.Parse(txtbh13.Text);
dd5 = double.Parse(txtbh14.Text);
dp6 = double.Parse(txtbh16.Text);
dd6 = double.Parse(txtbh17.Text);
dp7 = double.Parse(txtbh19.Text);
dd7 = double.Parse(txtbh20.Text);
pd1 = dd1 / dp1;
pd2 = dd2 / dp2;
pd3 = dd3 / dp3;
pd4 = dd4 / dp4;
pd5 = dd5 / dp5;
pd6 = dd6 / dp6;
pd7 = dd7 / dp7;
tph = pd1 + pd2 + pd3 + pd4 + pd5 + pd6 + pd7;
tdh = dd1 + dd2 + dd3 + dd4 + dd5 + dd6 + dd7;
txtbh3.Text = pd1.ToString();
txtbh6.Text = pd2.ToString();
txtbh9.Text = pd3.ToString();
txtbh12.Text = pd4.ToString();
txtbh15.Text = pd5.ToString();
txtbh18.Text = pd6.ToString();
txtbh21.Text = pd7.ToString();

}
}
}
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 planta_H : Form
{
public double dp1, dp2, dp3,dp4,dp5,dp6,dp7, dd1, dd2, dd3,dd4,dd5,dd6,dd7,pd1,pd2,pd3,pd4,pd5,pd6,pd7,tph,tdh;
public planta_H()
{
InitializeComponent();
dp1 = dp2 = dp3 =dp4 = dp5=dp6 = dp7= dd1 = dd2 = dd3 = dd4=dd5=dd6=dd7=pd1 = pd2 =pd3=pd4=pd5=pd6=pd7=tph=tdh= 0;
}

private void btplantah_Click(object sender, EventArgs e)
{
dp1 = double.Parse(txtbh.Text);
dd1 = double.Parse(txtbh2.Text);
dp2 = double.Parse(txtbh4.Text);
dd2 = double.Parse(txtbh5.Text);
dp3 = double.Parse(txtbh7.Text);
dd3 = double.Parse(txtbh8.Text);
dp4 = double.Parse(txtbh10.Text);
dd4 = double.Parse(txtbh11.Text);
dp5 = double.Parse(txtbh13.Text);
dd5 = double.Parse(txtbh14.Text);
dp6 = double.Parse(txtbh16.Text);
dd6 = double.Parse(txtbh17.Text);
dp7 = double.Parse(txtbh19.Text);
dd7 = double.Parse(txtbh20.Text);
pd1 = dd1 / dp1;
pd2 = dd2 / dp2;
pd3 = dd3 / dp3;
pd4 = dd4 / dp4;
pd5 = dd5 / dp5;
pd6 = dd6 / dp6;
pd7 = dd7 / dp7;
tph=pd1+pd2+pd3+pd4+pd5+pd6+pd7;
tdh = dd1 + dd2 + dd3 + dd4 + dd5 + dd6 + dd7;
txtbh3.Text=pd1.ToString();
txtbh6.Text = pd2.ToString();
txtbh9.Text = pd3.ToString();
txtbh12.Text = pd4.ToString();
txtbh15.Text = pd5.ToString();
txtbh18.Text = pd6.ToString();
txtbh21.Text = pd7.ToString();
}
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 WindowsFormsApplication
{
public partial class planta_m : Form
{
public double dp1, dp2, dp3, dp4, dp5, dp6, dp7, dd1, dd2, dd3, dd4, dd5, dd6, dd7, pd1, pd2, pd3, pd4, pd5, pd6, pd7, tph, tdh;
public planta_m()
{
InitializeComponent();
dp1 = dp2 = dp3 = dp4 = dp5 = dp6 = dp7 = dd1 = dd2 = dd3 = dd4 = dd5 = dd6 = dd7 = pd1 = pd2 = pd3 = pd4 = pd5 = pd6 = pd7 = tph = tdh = 0;
}

private void btplantah_Click(object sender, EventArgs e)
{
dp1 = double.Parse(txtbh.Text);
dd1 = double.Parse(txtbh2.Text);
dp2 = double.Parse(txtbh4.Text);
dd2 = double.Parse(txtbh5.Text);
dp3 = double.Parse(txtbh7.Text);
dd3 = double.Parse(txtbh8.Text);
dp4 = double.Parse(txtbh10.Text);
dd4 = double.Parse(txtbh11.Text);
dp5 = double.Parse(txtbh13.Text);
dd5 = double.Parse(txtbh14.Text);
dp6 = double.Parse(txtbh16.Text);
dd6 = double.Parse(txtbh17.Text);
dp7 = double.Parse(txtbh19.Text);
dd7 = double.Parse(txtbh20.Text);
pd1 = dd1 / dp1;
pd2 = dd2 / dp2;
pd3 = dd3 / dp3;
pd4 = dd4 / dp4;
pd5 = dd5 / dp5;
pd6 = dd6 / dp6;
pd7 = dd7 / dp7;
tph = pd1 + pd2 + pd3 + pd4 + pd5 + pd6 + pd7;
tdh = dd1 + dd2 + dd3 + dd4 + dd5 + dd6 + dd7;
txtbh3.Text = pd1.ToString();
txtbh6.Text = pd2.ToString();
txtbh9.Text = pd3.ToString();
txtbh12.Text = pd4.ToString();
txtbh15.Text = pd5.ToString();
txtbh18.Text = pd6.ToString();
txtbh21.Text = pd7.ToString();
}
}
}
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 planta_t : Form
{
public double dp1, dp2, dp3, dp4, dp5, dp6, dp7, dd1, dd2, dd3, dd4, dd5, dd6, dd7, pd1, pd2, pd3, pd4, pd5, pd6, pd7, tph, tdh;
public planta_t()
{
InitializeComponent();
dp1 = dp2 = dp3 = dp4 = dp5 = dp6 = dp7 = dd1 = dd2 = dd3 = dd4 = dd5 = dd6 = dd7 = pd1 = pd2 = pd3 = pd4 = pd5 = pd6 = pd7 = tph = tdh = 0;
}

private void btplantah_Click(object sender, EventArgs e)
{
dp1 = double.Parse(txtbh.Text);
dd1 = double.Parse(txtbh2.Text);
dp2 = double.Parse(txtbh4.Text);
dd2 = double.Parse(txtbh5.Text);
dp3 = double.Parse(txtbh7.Text);
dd3 = double.Parse(txtbh8.Text);
dp4 = double.Parse(txtbh10.Text);
dd4 = double.Parse(txtbh11.Text);
dp5 = double.Parse(txtbh13.Text);
dd5 = double.Parse(txtbh14.Text);
dp6 = double.Parse(txtbh16.Text);
dd6 = double.Parse(txtbh17.Text);
dp7 = double.Parse(txtbh19.Text);
dd7 = double.Parse(txtbh20.Text);
pd1 = dd1 / dp1;
pd2 = dd2 / dp2;
pd3 = dd3 / dp3;
pd4 = dd4 / dp4;
pd5 = dd5 / dp5;
pd6 = dd6 / dp6;
pd7 = dd7 / dp7;
tph = pd1 + pd2 + pd3 + pd4 + pd5 + pd6 + pd7;
tdh = dd1 + dd2 + dd3 + dd4 + dd5 + dd6 + dd7;
txtbh3.Text = pd1.ToString();
txtbh6.Text = pd2.ToString();
txtbh9.Text = pd3.ToString();
txtbh12.Text = pd4.ToString();
txtbh15.Text = pd5.ToString();
txtbh18.Text = pd6.ToString();
txtbh21.Text = pd7.ToString();

}
}
}

Pracitca 8_3 pseudocodigo
Declarar variables
double cph1, cph2, cph3, cph4, cph5, cph6, cph7;
double cdh1, cdh2, cdh3, cdh4, cdh5, cdh6, cdh7;
double cpg1, cpg2, cpg3, cpg4, cpg5, cpg6, cpg7;
double cdg1, cdg2, cdg3, cdg4, cdg5, cdg6, cdg7;
double cpt1, cpt2, cpt3, cpt4, cpt5, cpt6, cpt7;
double cdt1, cdt2, cdt3, cdt4, cdt5, cdt6, cdt7;


Print"Reporte de unidad de control de calidad de una linea";
Print"Planta Unidades Producidas Unidades defectuosas";
Print"Planta 1 Hermosillo " ;
Print"Introduce la cantidad de unidades producida dia 1 ";
read cph1
print"Introduce la cantidad de unidades defectuosas dia 1";
read cdh1
print"Introduce la cantidad de unidades producida dia 2 ";
read cph2
print"Introduce la cantidad de unidades defectuosas dia 2";
read cdh2
print"Introduce la cantidad de unidades producida dia 3 ";
read cph3
print"Introduce la cantidad de unidades defectuosas dia 3";
read cdh3
print"Introduce la cantidad de unidades producida dia 4 ";
read cph4
print"Introduce la cantidad de unidades defectuosas dia 4";
read cdh4
print"Introduce la cantidad de unidades producida dia 5 ";
read cph5
print"Introduce la cantidad de unidades defectuosas dia 5";
read cdh5
print"Introduce la cantidad de unidades producida dia 6 ";
read cph6
print"Introduce la cantidad de unidades defectuosas dia 6";
read cdh6

print"Introduce la cantidad de unidades producida dia 7 ";
readcph7

double hupt = cph1 + cph2 + cph3 + cph4 + cph5 + cph6 + cph7;
double Hudt = cdh1 + cdh2 + cdh3 + cdh4 + cdh5 + cdh6 + cdh7;
double hpdt = (Hudt / hupt) * 100;
print"porcentaje total de unidades defectuosos " + hpdt+"%";


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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double up1, cp1, cm1, cu1, cup1,up2,up3,up4,cp2,cp3,cp4,cm2,cm3,cm4,cup2,cup3,cup4, ts;
up1 = cp1 = cm1 = cu1 = cup1 = ts=up2=up3=up4=cp2=cp3=cp4=cm2=cm3=cm4=cup2=cup3=cup4= 0;
Console.WriteLine(" Unidades producidas Costo de produccion Costo materiales Costo unitario");
Console.WriteLine("_____________________________________________________________________________");
Console.WriteLine("Introduce la cantidad de unidades producidas");
up1=double.Parse(Console.ReadLine());
Console.WriteLine("Introduce el costo de operacion por produccion del dia");
cp1 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el costo de materiales utilizados");
cm1 = double.Parse(Console.ReadLine());
cup1 = (cp1 + cm1) / up1;
Console.WriteLine("costo unitario promedio dia 1" + cup1);
Console.WriteLine("Introduce la cantidad de unidades producidas dia 2");
up2 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce el costo de operacion por produccion del dia");
cp2 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el costo de materiales utilizados");
cm2 = double.Parse(Console.ReadLine());
cup2 = (cp2 + cm2) / up2;
Console.WriteLine("costo unitario promedio dia 2" + cup2);



Console.WriteLine("Introduce la cantidad de unidades producidas dia 3");
up3 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce el costo de operacion por produccion del dia");
cp3 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el costo de materiales utilizados");
cm3 = double.Parse(Console.ReadLine());
cup3 = (cp3 + cm3) / up3;
Console.WriteLine("costo unitario promedio dia 3" + cup3);


Console.WriteLine("Introduce la cantidad de unidades producidas dia 4");
up4 = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce el costo de operacion por produccion del dia");
cp4 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el costo de materiales utilizados");
cm4 = double.Parse(Console.ReadLine());
cup4 = (cp4 + cm4) / up4;
Console.WriteLine("costo unitario promedio dia 1" + cup1);
ts = (cup1 + cup2 + cup3 + cup4) / 4;

Console.WriteLine("Costo unitario promedio semanal"+ts);
Console.ReadKey();





}
}
}

Practi8_4pseudocodigo
declarar variables
double up1, cp1, cm1, cu1, cup1,up2,up3,up4,cp2,cp3,cp4,cm2,cm3,cm4,cup2,cup3,cup4, ts;
up1 = cp1 = cm1 = cu1 = cup1 = ts=up2=up3=up4=cp2=cp3=cp4=cm2=cm3=cm4=cup2=cup3=cup4= 0;
Print" Unidades producidas Costo de produccion Costo materiales Costo unitario";
print"_____________________________________________________________________________");
print"Introduce la cantidad de unidades producidas";
readup1=
print"Introduce el costo de operacion por produccion del dia";
read cp1
print"introduce el costo de materiales utilizados";
read cm1
cup1 = (cp1 + cm1) / up1;
print"costo unitario promedio dia 1" + cup1;

print"Introduce la cantidad de unidades producidas";
readup2=
print"Introduce el costo de operacion por produccion del dia2";
read cp2
print"introduce el costo de materiales utilizados";
read cm2
cup1 = (cp2 + cm2) / up2;
print"costo unitario promedio dia 2" + cup2;

print"Introduce la cantidad de unidades producidas";
read up3
print"Introduce el costo de operacion por produccion del dia3";
read cp3
print"introduce el costo de materiales utilizados";
read cm3
cup1 = (cp3 + cm3) / up3;
print"costo unitario promedio dia 3" + cup3;

print"Introduce la cantidad de unidades producidas";
readup4
print"Introduce el costo de operacion por produccion del dia4";
read cp4
print"introduce el costo de materiales utilizados";
read cm4
cup1 = (cp4 + cm4) / up4;
print"costo unitario promedio dia 4" + cup4;
Practica 8_4visual
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
{
dia1 d1;
dia2 d2;
dia3 d3;
dia4 d4;
double ts;
public Form1()
{
InitializeComponent();
d1 = new dia1();
d2 = new dia2();
d3 = new dia3();
d4 = new dia4();
ts = 0;
}

private void label1_Click(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
d1.Show();
}

private void button2_Click(object sender, EventArgs e)
{
d2.Show();
}

private void button3_Click(object sender, EventArgs e)
{
d3.Show();
}

private void button4_Click(object sender, EventArgs e)
{
d4.Show();
}

private void button5_Click(object sender, EventArgs e)
{
ts = (d1.cup1 + d2.cup2 + d3.cup3 + d4.cup4) / 4;
listBox1.Items.Add("Costo unitario promedio semanal");
listBox1.Items.Add(ts);
}
}
}

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 dia1 : Form
{
public double up, cp, cm, cup1;
public dia1()
{
InitializeComponent();
up = cp = cm = cup1 = 0;
}

private void button1_Click(object sender, EventArgs e)
{
up = double.Parse(textBox1.Text);
cp = double.Parse(textBox2.Text);
cm = double.Parse(textBox3.Text);
cup1 = (cp + cm) / up;
}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 dia2 : Form
{
public double up, cp, cm, cup2;
public dia2()
{
InitializeComponent();
up = cp = cm = cup2 = 0;
}

private void button1_Click(object sender, EventArgs e)
{
up = double.Parse(textBox1.Text);
cp = double.Parse(textBox2.Text);
cm = double.Parse(textBox3.Text);
cup2 = (cp + cm) / up;
}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}

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 dia3 : Form
{
public double up, cp, cm, cup3;
public dia3()
{
InitializeComponent();
up = cp = cm = cup3 = 0;
}

private void button1_Click(object sender, EventArgs e)
{
up = double.Parse(textBox1.Text);
cp = double.Parse(textBox2.Text);
cm = double.Parse(textBox3.Text);
cup3 = (cp + cm) / up;
}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}

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 dia4 : Form
{
public double up, cp, cm, cup4;
public dia4()
{
InitializeComponent();
up = cp = cm = cup4 = 0;
}

private void button1_Click(object sender, EventArgs e)
{
up = double.Parse(textBox1.Text);
cp = double.Parse(textBox2.Text);
cm = double.Parse(textBox3.Text);
cup4 = (cp + cm) / up;
}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}

miércoles, 24 de marzo de 2010

practica 7

Practica 7_1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string nombre;
char sexo;
int edad;
float estatura;
float peso;
int color_ojos;
int color_cabello;
int Num_F = 0;
int Num_M = 0;
int continuar = 1;
while (continuar == 1)
{
Console.WriteLine("Nombre estudiante : ");
nombre = Console.ReadLine();
Console.WriteLine("Sexo(F=Femenino M= Masculino)");
sexo = char.Parse(Console.ReadLine());
Console.WriteLine("Edad");
edad = int.Parse(Console.ReadLine());
Console.WriteLine("Estatura");
estatura = float.Parse(Console.ReadLine());
Console.WriteLine("Peso (en kilos)");
peso = float.Parse(Console.ReadLine());
Console.WriteLine("Color de ojos(1 azul, 2 castaño, 3otro )");
color_ojos = int.Parse(Console.ReadLine());
Console.WriteLine("color de cabellos (1 castaño, 2 rubio, 3 otro)");
color_cabello =int.Parse(Console.ReadLine());
if (sexo =='f' && estatura >= 1.65 && estatura <= 1.75 && peso < num_f =" Num_F" sexo ="=">= 1.70 && peso>=60 &&peso<=70) { Num_M = Num_M + 1; } Console.WriteLine("Desea registriar otro alumno ( 0=n 1 =si)"); continuar = int.Parse(Console.ReadLine()); } Console.WriteLine("Numero de Alumnos sexo femenino color ojos azul estatura >=1.65 y <=1.75, peso<55">1.70 peso entre 60 y 70Kg" + Num_M);
Console.ReadKey();






}
}
}

Practica 7_1 pseudocodigo

Declarar variables
string nombre;
char sexo;
int edad;
float estatura;
float peso;
int color_ojos;
int color_cabello;
int Num_F = 0;
int Num_M = 0;
int continuar = 1;
while (continuar == 1)
{
Print"Nombre estudiante : ";
Read nombre
Print "Sexo(F=Femenino M= Masculino)";
Read sexo
Print"Edad";
Read edad
Print"Estatura";
estatura = float.Parse(Console.ReadLine());
Print"Peso (en kilos)";
read peso;
Print"Color de ojos(1 azul, 2 castaño, 3otro )";
Read color_ojos;
Print "color de cabellos (1 castaño, 2 rubio, 3 otro)";
Read color_cabello ;
if (sexo =='f' && estatura >= 1.65 && estatura <= 1.75 && peso < num_f =" Num_F" sexo ="=">= 1.70 && peso>=60 &&peso<=70) { Num_M = Num_M + 1; } Print"Desea registriar otro alumno ( 0=n 1 =si)"; Read continuar; = } Print"Numero de Alumnos sexo femenino color ojos azul estatura >=1.65 y <=1.75, peso<55">1.70 peso entre 60 y 70Kg" + Num_M);

Practica 7_1 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 practica_7_1
{


public partial class Form1 : Form
{
string nombre;
char sexo;
int edad;
float Estatura, Peso;
int color_ojos, color_cabello;
int num_F,num_M;
public Form1()
{
InitializeComponent();
nombre = " ";
edad = 0;
Estatura = Peso = 0.0f;
color_ojos = color_cabello =num_F=num_M=0;
}

private void button1_Click(object sender, EventArgs e)
{
nombre = textBox1.Text;
if (checkBox1.Checked)
{
sexo = 'F';
}

if (checkBox2.Checked)
{
sexo = 'M';
}
edad = int.Parse(textBox2.Text);
Estatura = float.Parse(textBox3.Text);
Peso = float.Parse(textBox4.Text);
if (checkBox3.Checked)
{
color_ojos=1;
}
if (checkBox4.Checked)
{
color_ojos = 2;
}
if (checkBox5.Checked)
{
color_ojos = 3;
}
if (checkBox6.Checked)
{
color_cabello = 1;
}
if (checkBox7.Checked)
{
color_cabello = 2;
}
if (checkBox8.Checked)
{
color_cabello = 3;
}
if (sexo == 'F' && color_cabello ==2&& color_ojos==1 && Estatura >= 1.65f && Estatura <= 1.75f && Peso < 55)
{
num_F++;
}
if (sexo =='M'&& color_ojos == 2 && Estatura >1.70f && Peso >= 60&& Peso <= 70)
{
num_M++;
}

listBox1.Items.Add("No. de mujeres " + num_F);
listBox1.Items.Add("No de Hombres " + num_M);






}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = " ";
textBox2.Text = " ";
textBox3.Text = " ";
textBox4.Text = " ";
checkBox1.Checked = false;
checkBox2.Checked = false;
checkBox3.Checked = false;
checkBox4.Checked = false;
checkBox5.Checked = false;
checkBox6.Checked = false;
checkBox7.Checked = false;
checkBox8.Checked = false;
listBox1.Items.Clear();




Practica 7_2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int opcion;
double bm=0;
double camisa = 0;
double tenis = 0;
double toallaM = 0;
double pantalon = 0;
double valor= 0;
int continuar = 1;
Console.WriteLine("Numero de producto\tDescripcion\tPrecio de lista");
Console.WriteLine("\n1\t\t\tBolsa de mano\t$28.50\n2\t\t\tCamisa\t\t$45.0\n3\t\t\tTenis\t\t$99.0\n4\t\t\tToalla M\t$49.99\n5\t\t\tPantalon\t$68.50");

do
{
Console.WriteLine("selecciones opcion");
opcion = int.Parse(Console.ReadLine());

switch (opcion)
{
case 1:
Console.Write("cantidad de bolsas de mano: ");
bm = int.Parse(Console.ReadLine());
valor=valor+bm*28.50;


break;
case 2:
Console.Write("cantidad camisas: ");
camisa=int.Parse(Console.ReadLine());
valor=valor+camisa*45.0;
break;
case 3:
Console.Write("cantidad Tenis: ");
tenis=int.Parse(Console.ReadLine());
valor=valor+tenis*99.0;
break;
case 4:
Console.Write("cantidad ToallasM: ");
toallaM=int.Parse(Console.ReadLine());
valor=valor+toallaM*49.99;
break;
case 5:
Console.Write("cantidad Pantalones: ");
pantalon=int.Parse(Console.ReadLine());
valor=valor+pantalon*45.0;
break;
}
Console.WriteLine("desea agregar otro producto 1=si , 0= calculo de factura ");
continuar=int.Parse(Console.ReadLine());

}

while (continuar == 1);
Console.WriteLine("cantidad Producto subtotal");
if (bm > 0)
{
Console.WriteLine("{0}\t\bolsa de mano\t\t{1}", bm, bm * 28.50);
}
if (camisa > 0)
{
Console.WriteLine("{0}\tcamisa\t\t{1}",camisa, camisa * 45.0);
}
if (tenis > 0)
{
Console.WriteLine("{0}\ttenis\t\t{1}", tenis, tenis * 99.0);
}
if (toallaM > 0)
{
Console.WriteLine("{0}\ttoalla M\t\t{1}", toallaM, toallaM * 49.99);
}
if (pantalon > 0)
{
Console.WriteLine("{0}\tpantalon\t\t{1}", pantalon, pantalon * 68.50);
}
Console.WriteLine("\t\t\t\tSubtotal={0}", valor);
Console.WriteLine("\t\t\t\tIva(11%)={0}", valor * .11);
Console.WriteLine("\t\t\t\ttotal={0}", valor * 1.11);
Console.ReadKey();

}
}

Practica 7_2 Pseudocodigo
Declarar variables
int opcion;
double bm=0;
double camisa = 0;
double tenis = 0;
double toallaM = 0;
double pantalon = 0;
double valor= 0;
int continuar = 1;
Print"Numero de producto Descripcion Precio de lista";
Print "1 Bolsa de mano t$28.50\n2\t\t\tCamisa\t\t$45.0\n3\t\t\tTenis\t\t$99.0\n4\t\t\tToalla M\t$49.99\n5\t\t\tPantalon\t$68.50";

do
{
Print"selecciones opcion";
Read opcion

switch (opcion)
{
case 1:
Print"cantidad de bolsas de mano: ";
Read bm ;
valor=valor+bm*28.50;


break;
case 2:
Print"cantidad camisas: ";
Read camisa;
valor=valor+camisa*45.0;
break;
case 3:
Print"cantidad Tenis: ";
Read tenis;
valor=valor+tenis*99.0;
break;
case 4:
Print"cantidad ToallasM: ";
Read toallaM;
valor=valor+toallaM*49.99;
break;
case 5:
Print"cantidad Pantalones: ");
pantalon=int.Parse(Console.ReadLine());
valor=valor+pantalon*45.0;
break;
}
Print"desea agregar otro producto 1=si , 0= calculo de factura ";
Read continuar

}

while (continuar == 1);
Print"cantidad Producto subtotal";
if (bm > 0)
{
Print("{0}\t\bolsa de mano\t\t{1}", bm, bm * 28.50);
}
if (camisa > 0)
{
Print("{0}\tcamisa\t\t{1}",camisa, camisa * 45.0);
}
if (tenis > 0)
{
Print("{0}\ttenis\t\t{1}", tenis, tenis * 99.0);
}
if (toallaM > 0)
{
Print("{0}\ttoalla M\t\t{1}", toallaM, toallaM * 49.99);
}
if (pantalon > 0)
{
Print("{0}\tpantalon\t\t{1}", pantalon, pantalon * 68.50);
}
Print("\t\t\t\tSubtotal={0}", valor);
("\t\t\t\tIva(11%)={0}", valor * .11);
Print("\t\t\t\ttotal={0}", valor * 1.11);
Practica 7_2visual
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
{
bolsa bm;
camisa cm;
pantalon pt;
tenis tn;
toalla tm;
public Form1()
{
InitializeComponent();
bm = new bolsa();
cm = new camisa();
pt = new pantalon();
tn = new tenis();
tm = new toalla();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
bm.Show();
}

private void button2_Click(object sender, EventArgs e)
{
cm.Show();
}

private void button3_Click(object sender, EventArgs e)
{
tn.Show();
}

private void button4_Click(object sender, EventArgs e)
{
tm.Show();
}

private void button5_Click(object sender, EventArgs e)
{
pt.Show();
}

private void button6_Click(object sender, EventArgs e)
{
if (bm.b > 0)
{
listBox1.Items.Add("bolsa de mano " + bm.total);

}
if (cm.b> 0)
{
listBox1.Items.Add("camisa " + cm.total);
}
if (tn.b > 0)
{
listBox1.Items.Add("tenis " + tn.total);
}
if (tm.b > 0)
{
listBox1.Items.Add("toalla " + cm.total);
}

}
}
}
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 bolsa : Form
{
public double total, b;
public bolsa()
{
InitializeComponent();
b = total = 0;
}

private void button1_Click(object sender, EventArgs e)
{
b = double.Parse(textBox1.Text);
total = total + (b * 28.50);
label2.Text = "total" +total;
}

private void button2_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 camisa : Form
{
public double total, b;
public camisa()
{
InitializeComponent();
b = total = 0;
}

private void button1_Click(object sender, EventArgs e)
{
b = double.Parse(textBox1.Text);
total = total + (b * 45.00);
label2.Text = "total" + total;
}

private void button2_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 camisa : Form
{
public double total, b;
public camisa()
{
InitializeComponent();
b = total = 0;
}

private void button1_Click(object sender, EventArgs e)
{
b = double.Parse(textBox1.Text);
total = total + (b * 45.00);
label2.Text = "total" + total;
}

private void button2_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}

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
{
bolsa bm;
camisa cm;
pantalon pt;
tenis tn;
toalla tm;
public Form1()
{
InitializeComponent();
bm = new bolsa();
cm = new camisa();
pt = new pantalon();
tn = new tenis();
tm = new toalla();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
bm.Show();
}

private void button2_Click(object sender, EventArgs e)
{
cm.Show();
}

private void button3_Click(object sender, EventArgs e)
{
tn.Show();
}

private void button4_Click(object sender, EventArgs e)
{
tm.Show();
}

private void button5_Click(object sender, EventArgs e)
{
pt.Show();
}

private void button6_Click(object sender, EventArgs e)
{
if (bm.b > 0)
{
listBox1.Items.Add("bolsa de mano " + bm.total);

}
if (cm.b> 0)
{
listBox1.Items.Add("camisa " + cm.total);
}
if (tn.b > 0)
{
listBox1.Items.Add("tenis " + tn.total);
}
if (tm.b > 0)
{
listBox1.Items.Add("toalla " + cm.total);
}

}
}
}


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 pantalon : Form
{

public double total, b;
public pantalon()
{
InitializeComponent();
b = total = 0;
}

private void label1_Click(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
b = double.Parse(textBox1.Text);
total = total + (b * 68.50);
label2.Text = "total" + total;
}
}
}

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 tenis : Form
{
public double total, b;
public tenis()
{
InitializeComponent();
b = total = 0;
}

private void button1_Click(object sender, EventArgs e)
{
b = double.Parse(textBox1.Text);
total = total + (b * 99.00);
label2.Text = "total" + total;
}

private void button2_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}






Practica 7_3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace practica_7_problema_3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Serie = 1 + 1.0/2.0 + 1.0/4.0 + 1.0/6.0 + 1.0");
double serie = 1;
int contador = 1;
double denominador = 0.0;
Console.Write("serie= 1+/t");
while (contador < denominador =" denominador" serie =" serie" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdWaA0Qkk84XiUvLuX-RQdCxOi0gUgE51AM9HOscY8zx3zR022IOxuf2nQlPPpCEcLDdZ2b_3FkpJ-XoqC1LqNsiWETAgB_rVNOn6zNf1Rq2NqLLmg-qq7bo_zP-q3enL2LNnWJt87kBII/s1600/7_3c.bmp">
Practica 7_3visual
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 Practica7_3
{
public partial class Form1 : Form
{
double serie ;
int contador ;
double denominador;

public Form1()
{
InitializeComponent();
double serie = 1;
int contador = 1;
double denominador = 0.0;

}

private void button1_Click(object sender, EventArgs e)
{
while (contador < 20)
{
denominador = denominador + 2.0;
listBox1.Items.Add(+denominador);
serie = serie + 1.0 / denominador;
contador++;
}
listBox1.Items.Add("serie"+serie);

}
}
}




Practica 7_3 Pseudocodigo
Print"Serie = 1 + 1.0/2.0 + 1.0/4.0 + 1.0/6.0 + 1.0";
double serie = 1;
int contador = 1;
double denominador = 0.0;
Print("serie= 1+/t");
while (contador < denominador =" denominador" serie =" serie" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 197px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdWaA0Qkk84XiUvLuX-RQdCxOi0gUgE51AM9HOscY8zx3zR022IOxuf2nQlPPpCEcLDdZ2b_3FkpJ-XoqC1LqNsiWETAgB_rVNOn6zNf1Rq2NqLLmg-qq7bo_zP-q3enL2LNnWJt87kBII/s400/7_3c.bmp" alt="" id="BLOGGER_PHOTO_ID_5452312363074878930" border="0">

lunes, 1 de marzo de 2010

practica 6

Practica 6_1

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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int opcion;
do
{

double area = 0, perimetro = 0, lado = 0,lado1=0,lado2=0,lado3=0, ancho = 0, largo = 0, radio = 0,dma=0,dme=0;
Console.WriteLine("Opciones a elegir");
Console.WriteLine("Calculo de area y perimetro");
Console.WriteLine("\t1)cuadrado\n\t2)Rectangulo\n\t3)Circulo\n\t4)traingulo\n\t5)rombo");
Console.WriteLine("elegir opcion (1-5): ");
opcion = int.Parse(Console.ReadLine());
switch (opcion)
{
case 0: Console.WriteLine("fin de programa");
Console.BackgroundColor=ConsoleColor.Yellow;

break;
case 1: Console.Clear();

Console.Write("\tCalculo area y perimetro de un cuadrado");
Console.Write("Introduce valor de lado");
lado = double.Parse(Console.ReadLine());
area = lado * lado;
perimetro = lado * 4;
break;
case 2: Console.Clear();

Console.WriteLine("\tCalculo area y perimetro de un rectangulo");
Console.Write("Introduce valor de largo : ");
largo = double.Parse(Console.ReadLine());
Console.Write("\tIntroduce valor de ancho : ");
ancho = double.Parse(Console.ReadLine());
area = largo * ancho;
perimetro = 2 * (largo + ancho);
break;
case 3: Console.Clear();
Console.WriteLine("\tcalculo area y perimetro de un circulo");
Console.Write("introduce el valor del radio ");
radio = double.Parse(Console.ReadLine());

area = Math.PI * Math.Pow(radio, 2);
perimetro = 2 * radio * Math.PI;
break;
case 4: Console.Clear();
Console.WriteLine("\tcalculo area y perimetro de un triangulo");
Console.Write("introduce valor del lado 1 ");
lado1 = double.Parse(Console.ReadLine());
Console.Write("Introduce valor del lado 2 ");
lado2 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce valor del lado 3 ");

lado3 = double.Parse(Console.ReadLine());
double p = (lado1 + lado2 + lado3) / 2;


area = Math.Sqrt(p*(p-lado1)*(p-lado2)*(p-lado3));
perimetro = lado1 + lado2 + lado3;
break;

default:
Console.WriteLine("presiono opcion equivocada ");
break;
case 5 :
Console.Clear();
Console.WriteLine("area perimetro de un rombo ");
Console.Write("introduce valor del diagonal menor");
dme = double.Parse(Console.ReadLine());
Console.WriteLine("introduce valor del diagonal mayor ");
dma = double.Parse(Console.ReadLine());
area = (dma * dme) / 2;
perimetro =4*dme;
break;

}
Console.WriteLine("area={0:f2} perimetro={1:f2}", area, perimetro);
Console.ReadKey();

}
while (opcion != 0);
Console.ReadKey();


}
}
}
Practica 6_1
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
{
public Form1()
{
InitializeComponent();
}

private void label1_Click(object sender, EventArgs e)
{

}


private void button1_Click(object sender, EventArgs e)
{ double clado1 = 0 ;

double carea = 0;
double cperimetro = 0;

clado1 = double.Parse(textBox1.Text);
carea = Math.Pow(clado1,2);
cperimetro = clado1 * 4;
label2.Text = ("Area: ") + carea;
label3.Text = ("Perimetro: ") + cperimetro;

double rancho = 0;
double rlargo = 0;
double rarea = 0;
double rperimetro = 0;
rlargo = double.Parse(textBox2.Text);
rancho = double.Parse(textBox3.Text);
rarea = rancho * rlargo ;
rperimetro = 2 * rlargo + 2 * rancho;
label9.Text = ("Area: ") + rarea;
label8.Text = ("Perimetro: ") + rperimetro;


double tlado = 0;
double tbase = 0;
double taltura = 0;
double tarea = 0;
double tperimetro = 0;
tlado = double.Parse(textBox4.Text);
taltura = double.Parse(textBox5.Text);
tbase = double.Parse(textBox6.Text);
tarea = tbase * taltura / 2;
tperimetro = tbase + tlado + tlado;
label14.Text = ("Area: ") + tarea;
label15.Text = ("Perimetro: ") + tperimetro;


double ciradio = 0;
double ciarea = 0;
double ciperimetro = 0;
ciradio = double.Parse(textBox7.Text);
ciarea = 3.1416* Math.Pow(ciradio,2);
ciperimetro = 2*3.1416*ciradio;
label18.Text = ("Area: ") +ciarea;
label19.Text = ("perimetro") +ciperimetro;

double rolado =0;
double rodiagonalma =0;
double rodiagonalme =0;
double roarea = 0;
double roperimetro = 0;
rolado = double.Parse(textBox8.Text);
rodiagonalma = double.Parse(textBox9.Text);
rodiagonalme = double.Parse(textBox10.Text);
roarea = rodiagonalma * rodiagonalme / 2;
roperimetro = 4 * rolado;
label24.Text = ("Area: ") + roarea;
label25.Text = ("Perimetro:") + roperimetro;



6_1Pseudocodigo
1. Definir variables int opcion;
do
{

double area = 0, perimetro = 0, lado = 0,lado1=0,lado2=0,lado3=0, ancho = 0, largo = 0, radio = 0,dma=0,dme=0;
Print"Opciones a elegir";
Print"Calculo de area y perimetro";
Print"t1)cuadrado2)Rectangulo3)Circulo4)traingulo5)rombo";
Print"elegir opcion (1-5): ";
Read opcion;
switch (opcion)
{
case 0: Print"fin de programa";


break;
case 1:

Print"Calculo area y perimetro de un cuadrado";
Print"Introduce valor de lado";
Read lado;
area = lado * lado;
perimetro = lado * 4;
break;
case 2:

Print"Calculo area y perimetro de un rectangulo";
Print"Introduce valor de largo : ";
Read largo;
Print"Introduce valor de ancho : ";
Read ancho:
area = largo * ancho;
perimetro = 2 * (largo + ancho);
break;
case 3:
Print"tcalculo area y perimetro de un circulo";
Print"introduce el valor del radio ";
Read radio

area = Math.PI * Math.Pow(radio, 2);
perimetro = 2 * radio * Math.PI;
break;
case 4:
Print"calculo area y perimetro de un triangulo";
Print"introduce valor del lado 1 ";
read lado1
Print"Introduce valor del lado 2 ";
Read lado 2;
Print"introduce valor del lado 3 ";

Read lado 3
double p = (lado1 + lado2 + lado3) / 2;


area = Math.Sqrt(p*(p-lado1)*(p-lado2)*(p-lado3));
perimetro = lado1 + lado2 + lado3;
break;

default:
Print"presiono opcion equivocada ";
break;
case 5 :

Print"area perimetro de un rombo ";
Print"introduce valor del diagonal menor");
Read dm3
Print"introduce valor del diagonal mayor ";
Read dma;
area = (dma * dme) / 2;
perimetro =4*dme;
break;

}
Print"area= perimetro=", area, perimetro);


}
while (opcion != 0);

Practica 6_2

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

namespace ConsoleApplication1
{

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


double franco = 0, libra = 1.84, dracmas = 0, florines = 0, dolar = 1.06, dc = 0, dn = 0, conversion = 0, c2 = 0;
string Opcion;
do {


Console.WriteLine("seleccione Opcion");
Console.WriteLine("Selecciones el tipo de moneda");
Console.WriteLine("\ta)Florines Holandeses a dolares canadienses\n\tb)Dracmas griegas a dolar americano\n\tc)Dolar canadienses a libras britanicas\n\td)Dolares norteamericanos a francos franceses");
Opcion = Console.ReadLine();
switch (Opcion)
{

case "a": Console.Clear();
Console.WriteLine("Introduce la cantidad florines");
florines = double.Parse(Console.ReadLine());
conversion = florines * 43.20 / 100;
Console.WriteLine("Total de dolares canadienses ={0:f2} " , conversion);

Console.ReadKey();
Console.Clear();

break;
case "b": Console.Clear();
Console.WriteLine("Introduce la cantidad de dracmas griegas");
dracmas = double.Parse(Console.ReadLine());
conversion = (dracmas * 2.95 / 100) / dolar;
Console.WriteLine("total de dolares norteamericanos={0:f2}" , conversion);
Console.ReadKey();
Console.Clear();
break;
case "c": Console.Clear();
Console.WriteLine("Introduce la cantidad en dolares");
dc= double.Parse(Console.ReadLine());
conversion = dc / libra;
Console.WriteLine("total de libras ={0:f2}" , conversion);
Console.ReadKey();
Console.Clear();

break;
case "d": Console.Clear();
Console.WriteLine("Introduce la cantidad en dolares");
dn = double.Parse(Console.ReadLine());
conversion = dn * dolar;
c2 = conversion*100/21.55;

Console.WriteLine("total de francos ={0:f2}", c2);
Console.ReadKey();
Console.Clear();

break;
case "F":
case "f": Console.WriteLine("Opcion equivocada");
break;





}

}
while (Opcion != "f" && Opcion != "F") ;


}
}
}

Practica 6_2visual

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
{
florines f;
dracmas d;
dolares_canadienses dc;
dolares_americanos da;
public Form1()
{
InitializeComponent();
f = new florines();
d = new dracmas();
dc = new dolares_canadienses();
da = new dolares_americanos();
}

private void button1_Click(object sender, EventArgs e)
{
f.Show();
}

private void button2_Click(object sender, EventArgs e)
{
d.Show();
}

private void button3_Click(object sender, EventArgs e)
{
dc.Show();
}

private void button4_Click(object sender, EventArgs e)
{
da.Show();
}
}
}

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 dolares_americanos : Form
{
public double t, total, cantidad;
public dolares_americanos()
{
InitializeComponent();
t = total = cantidad = 0;
}

private void button1_Click(object sender, EventArgs e)
{
cantidad = double.Parse(Console.ReadLine());
t = cantidad * 1.06;
total = (t * 100) / 21.55;
label2.Text = "total" + total;
}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 dolares_canadienses : Form
{
public double cantidad, total;
public dolares_canadienses()
{
InitializeComponent();
total = cantidad = 0;
}

private void button1_Click(object sender, EventArgs e)
{
cantidad = double.Parse(textBox1.Text);
total = cantidad / 1.84;
label2.Text = "total" + total;

}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 dolares_canadienses : Form
{
public double cantidad, total;
public dolares_canadienses()
{
InitializeComponent();
total = cantidad = 0;
}

private void button1_Click(object sender, EventArgs e)
{
cantidad = double.Parse(textBox1.Text);
total = cantidad / 1.84;
label2.Text = "total" + total;

}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 dolares_canadienses : Form
{
public double cantidad, total;
public dolares_canadienses()
{
InitializeComponent();
total = cantidad = 0;
}

private void button1_Click(object sender, EventArgs e)
{
cantidad = double.Parse(textBox1.Text);
total = cantidad / 1.84;
label2.Text = "total" + total;

}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}

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 dracmas : Form
{

public double cantidad, total,t;
public dracmas()
{
InitializeComponent();
total = cantidad =t= 0;
}

private void label1_Click(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
cantidad = double.Parse(textBox1.Text);
t = (cantidad * 2.95) / 100;
total = t * 1.06;
label2.Text = "total" + total;


}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 florines : Form
{
public double total, cantidad;
public florines()

{
InitializeComponent();
total = cantidad = 0;
}

private void button1_Click(object sender, EventArgs e)
{
cantidad = double.Parse(textBox1.Text);
total = (cantidad * 43.20) / 100;
label2.Text = "total"+ total;
}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
Practica6_2 Pseudocodigo
Declarar variables
double franco = 0, libra = 1.84, dracmas = 0, florines = 0, dolar = 1.06, dc = 0, dn = 0, conversion = 0, c2 = 0;
string Opcion;
do {


Print"seleccione Opcion");
Print"Selecciones el tipo de moneda");
Print"a)Florines Holandeses a dolares canadienses b)Dracmas griegas a dolar americano c)Dolar canadienses a libras britanicas d)Dolares norteamericanos a francos franceses";
Read Opcion
switch (Opcion)
{

case "a":
Print"Introduce la cantidad florines";
Read Florines;
conversion = florines * 43.20 / 100;
Print"Total de dolares canadienses = " , conversion;



break;
case "b":
Print"Introduce la cantidad de dracmas griegas";
Read dracmas;
conversion = (dracmas * 2.95 / 100) / dolar;
Print"total de dolares norteamericanos=" , conversion;

break;
case "c":
Print"Introduce la cantidad en dolares";
Read dc;
conversion = dc / libra;
Print"total de libras =" , conversion;

break;
case "d":
Print"Introduce la cantidad en dolares";
Read dn;
conversion = dn * dolar;
c2 = conversion*100/21.55;

Print"total de francos =", c2;


break;
case "F":
case "f": Print"Opcion equivocada";
break;

Practica 6_3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace practica_6_problema_3
{
class Program
{
static void Main(string[] args)
{
string tipo;
double celsius=0, grado=0, kelvin=0, rankine=0, fahrenheit=0;
do
{
Console.Clear();
Console.WriteLine("Conversiones de Temperaturas");
Console.WriteLine("\nTipo de grados:");
Console.WriteLine("\n\ta)Fahrenheit\n\tb)Celsius\n\tc)Kelvin\n\td)Rankine\n\te)Salir");
Console.Write("\nElegir el tipo de grado que desea convertir: ");
tipo = Console.ReadLine();
switch (tipo)
{
case "A":
case "a": Console.Clear();
Console.Write("\nIntroducir la cantidad de grados Fahrenheit= ");
grado = double.Parse(Console.ReadLine());
celsius = (5.0 / 9.0) * (grado - 32);
kelvin = celsius + 273;
rankine = grado + 460;
Console.WriteLine("\n\tFahrenheit\tCelsius \tKelvin \tRankine");

Console.WriteLine("\t{0:f2} \t{1:f2} °C \t{2:f2} °K \t{3:f2} °R",grado+ "°F",celsius,kelvin,rankine);
break;

case "B":
case "b": Console.Clear();
Console.Write("\nIntroducir la cantidad de grados Celsius= ");
grado = double.Parse(Console.ReadLine());
fahrenheit = (9.0 / 5.0) * grado + 32.00;
kelvin = grado + 273;
rankine = fahrenheit + 460;

Console.WriteLine("\t{0:f2} °C \t{1:f2} °F \t{2:f2} °K \t{3:f2} °R",grado,fahrenheit,kelvin,rankine);
break;

case "C":
case "c": Console.Clear();
Console.Write("\nIntroducir la cantidad de grados Kelvin= ");
grado = double.Parse(Console.ReadLine());
celsius = grado - 273;
fahrenheit = (9.0 / 5.0) * celsius + 32.00;
rankine = fahrenheit + 460;

Console.WriteLine("\t{0:f2} °K \t{1:f2} °C \t{2:f2} °F \t{3:f2} °R",grado,celsius,fahrenheit,rankine);
break;

case "D":
case "d": Console.Clear();
Console.Write("\nIntroducir la cantidad de grados Rankine= ");
grado = double.Parse(Console.ReadLine());
fahrenheit = grado - 460;
celsius = (5.0 / 9.0) * (fahrenheit - 32.00);
kelvin = celsius + 273;

Console.WriteLine("\t{0:f2} °R \t{1:f2} °F \t{2:f2} °C \t{3:f2} °K",grado,fahrenheit,celsius,kelvin);
break;

case "E":
case "e": Console.WriteLine("Fin del programa");
break;

default:
Console.WriteLine("Presiono la opcion equivocada");
break;
}
Console.ReadKey();

}
while(tipo !="e" && tipo !="E");



}
}
}
Practica 6_3 Pseudocodigo
Declarar variables string tipo;
double celsius=0, grado=0, kelvin=0, rankine=0, fahrenheit=0;
do
{

Print"Conversiones de Temperaturas";
Print"Tipo de grados:";
Print"a)Fahrenheit b)Celsius c)Kelvin d)Rankine e)Salir";
Print"Elegir el tipo de grado que desea convertir: ";
Read Tipo
switch (tipo)
{
case "A":
case "a":
Print"Introducir la cantidad de grados Fahrenheit= ";
Read grado
celsius = (5.0 / 9.0) * (grado - 32);
kelvin = celsius + 273;
rankine = grado + 460;
Print"Fahrenheit Celsius Kelvin Rankine";

Print" {0:f2} {1:f2} °C {2:f2} °K {3:f2} °R",grado+ "°F",celsius,kelvin,rankine;
break;

case "B":
case "b":
Print" Introducir la cantidad de grados Celsius= ";
Read grado
fahrenheit = (9.0 / 5.0) * grado + 32.00;
kelvin = grado + 273;
rankine = fahrenheit + 460;

Print"\t{0:f2} °C \t{1:f2} °F \t{2:f2} °K \t{3:f2} °R",grado,fahrenheit,kelvin,rankine;
break;

case "C":
case "c":
Print"Introducir la cantidad de grados Kelvin= ";
Read grado
celsius = grado - 273;
fahrenheit = (9.0 / 5.0) * celsius + 32.00;
rankine = fahrenheit + 460;

Print"\t{0:f2} °K \t{1:f2} °C \t{2:f2} °F \t{3:f2} °R",grado,celsius,fahrenheit,rankine;
break;

case "D":
case "d":
Print"Introducir la cantidad de grados Rankine= ";
Read grado
fahrenheit = grado - 460;
celsius = (5.0 / 9.0) * (fahrenheit - 32.00);
kelvin = celsius + 273;

Print"\t{0:f2} °R \t{1:f2} °F \t{2:f2} °C \t{3:f2} °K",grado,fahrenheit,celsius,kelvin;
break;

case "E":
case "e": Print"Fin del programa";
break;

default:
Print"Presiono la opcion equivocada");
break;
}


}
while(tipo !="e" && tipo !="E");



Practica 6_3visual
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
{
fahrenheit f;
celsius c;
kelvin k;
rankine r;
public Form1()
{
InitializeComponent();
f = new fahrenheit();
c = new celsius();
k =new kelvin();
r = new rankine();

}

private void button3_Click(object sender, EventArgs e)
{
k.Show();
}

private void button1_Click(object sender, EventArgs e)
{
f.Show();
}

private void button2_Click(object sender, EventArgs e)
{
c.Show();
}

private void button4_Click(object sender, EventArgs e)
{
r.Show();
}
}
}
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 celsius : Form
{
public double grado , kr , rr, fr ;
public celsius()
{
InitializeComponent();
grado = kr = rr= fr = 0;
}

private void button1_Click(object sender, EventArgs e)
{
grado = double.Parse(textBox1.Text);
fr = (9.0 / 5.0) * grado + 32.00;
kr = grado + 273;
rr = fr + 460;
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label2.Text = "";
label3.Text = "";
label4.Text = "";
}
}
}
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 fahrenheit : Form
{
public double cr, grado, kr, rr;
public fahrenheit()
{
InitializeComponent();
cr= grado= kr= rr= 0;
}

private void button1_Click(object sender, EventArgs e)
{
grado = double.Parse(textBox1.Text);
cr = (5.0 / 9.0) * (grado - 32);
kr = cr + 273;
rr = grado + 460;
label2.Text = "C"+cr;
label3.Text = "K"+kr;
label4.Text = "R" + rr;

}

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

}

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 kelvin : Form
{
public double cr, grado, kr, rr, fr;
public kelvin()
{
InitializeComponent();
cr= grado = kr = rr = fr = 0;
}

private void button1_Click(object sender, EventArgs e)
{
grado = double.Parse(textBox1.Text);
cr = grado - 273;
fr = (9.0 / 5.0) * cr+ 32.00;
rr= fr + 460;
}

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

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}
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 rankine : Form
{
public double cr, grado, kr, rr, fr;
public rankine()
{
InitializeComponent();
cr = grado = kr = rr = fr = 0;
}

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


private void button1_Click(object sender, EventArgs e)
{
grado = double.Parse(textBox1.Text);
fr = grado - 460;
cr = (5.0 / 9.0) * (fr - 32.00);
kr = cr + 273;

}

private void button3_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}