20100427
cual es tu caracter.
ando en busca de tu nombre espero saber que si esta bien lo que hago,. suerte., mucha suerte por que espero verte en otro nivel.
20091216
PRACTICA 12.3 EJEMPLOS DE METODOS.
pseudocodigo
double num1, num2;
float suma()
{
return num1 + num2;
}
float multiplicacion()
{
return num1 * num2;
}
Read num1
Readnum2
double a1 = suma();
double a2 = multiplicacion();
Print a1
Print a2
FIN

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
double num1, num2;
double suma()
{
return num1 + num2;
}
double multiplicacion()
{
return num1 * num2;
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
num1 = double.Parse(textBox1.Text);
num2 = double.Parse(textBox2.Text);
double a1 = suma();
double a2 = multiplicacion();
textBox3.Text = ("la Suma es :" + a1);
textBox4.Text = ("La multiplicacion es : " + a2);
}
}
}
double num1, num2;
float suma()
{
return num1 + num2;
}
float multiplicacion()
{
return num1 * num2;
}
Read num1
Readnum2
double a1 = suma();
double a2 = multiplicacion();
Print a1
Print a2
FIN

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
double num1, num2;
double suma()
{
return num1 + num2;
}
double multiplicacion()
{
return num1 * num2;
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
num1 = double.Parse(textBox1.Text);
num2 = double.Parse(textBox2.Text);
double a1 = suma();
double a2 = multiplicacion();
textBox3.Text = ("la Suma es :" + a1);
textBox4.Text = ("La multiplicacion es : " + a2);
}
}
}
PRACTICA 13.1CLASE LLAMADA RECTANGULO ( visual).

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WindowsFormsApplication1
{
class rectangulo
{
double ancho, largo;
public rectangulo()
{
ancho = 0;
largo = 0;
}
public void Asignardatos(double w, double h)
{
ancho = w;
largo = h;
}
public void Asignarancho(double w)
{
ancho = w;
}
public void Asignarlargo(double h)
{
largo = h;
}
public double Obtenerancho()
{
return ancho;
}
public double Obtenerlargo()
{
return largo;
}
public double Area()
{
return largo * ancho;
}
public double Perimetro()
{
return 2 * (largo + ancho);
}
}
}
........................................................................................
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
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Focus();
double h, w;
rectangulo r1 = new rectangulo();
h = double.Parse(textBox1.Text);
w = double.Parse(textBox2.Text);
r1.Asignarancho(w);
r1.Asignarlargo(h);
textBox3.Text = ("El perimetro es = " + r1.Perimetro());
textBox4.Text = ("El areala es = " + r1.Area());
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
}
}
20091215
PRACTICA 12.2 COMPAÑIA MANUFACTURERA (Consola)..
pseudocodigo
int suma = 0, mayor = 0, np = 0, diap = 0;
int r, c;
string plantas[12];
int[,] produccion[13, 8];
for (r = 0; r < 12; r++)
{
Print "Nombre Planta",r+1
Read plantas [r]
suma=0;
for (c = 0; c < 7; c++)
{
Print "Producto de la planta", r + 1)
Print "Dia”, c + 1
Read produccion[r, c]
suma = suma + produccion[r, c];
}
produccion[r, 7] = suma;
}
for (c = 0; c < 7; c++)
{
suma = 0;
for (r = 0; r < 11; r++)
{
suma = suma + produccion[r, c];
}
produccion[12, c] = suma;
}
for (r = 0; r < 11; r++)
{
if (produccion[r, 7] > mayor)
{
mayor = produccion[r, 7];
np = r + 1;
}
}
Print "Plantas mas productivas ", np + 1
Print "Produccion de la pantal mas productiva ", produccion[np, 7]
mayor = 0;
for (c = 0; c < 8; c++)
{
if (produccion[12, c] > mayor)
{
mayor = produccion[12, c];
diap = c + 1;
}
}
Print "Dia con mayor produccion:"
switch(diap)
{
case 1: print "dia 1"
break;
case 2: print "dia 2"
break;
case 3: print "dia 3"
break;
case 4: print "dia 4"
break;
case 5: print "dia 5"
break;
case 6: print "Sabado"
break;
case 7: print "Domingo"
break;
}
Print "Mayor Produccion en un dia", mayor
FIN

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int suma = 0, mayor = 0, np=0, diap=0;
int r, c;
string []plantas= new string [12];
int [,] produccion= new int [13,8];
for (r = 0; r < 12; r++)
{
Console.WriteLine("Nombre Planta {0}",r+1);
plantas [r]= Console.ReadLine();
suma=0;
for (c = 0; c < 7; c++)
{
Console.WriteLine("Producto de la planta {0}",r+1);
Console.WriteLine("Dia {0}", c+1);
produccion [r,c]= int.Parse(Console.ReadLine());
suma=suma+produccion[r,c];
}
produccion [r,7]=suma;
}
for(c = 0; c < 7; c++)
{
suma=0;
for(r = 0; r < 11; r++)
{
suma=suma+produccion[r,c];
}
produccion[12,c]=suma;
}
for(r = 0; r < 11; r++)
{
if (produccion[r,7]>mayor)
{
mayor=produccion[r,7];
np=r+1;
}
}
Console.WriteLine("Plantas mas productivas {0}", np+1);
Console.WriteLine("Produccion de la pantal mas productiva {0}",produccion[np,7]);
mayor=0;
for(c = 0; c < 8; c++)
{
if(produccion[12,c]>mayor)
{
mayor=produccion[12,c];
diap=c+1;
}
}
Console.WriteLine("Dia con mayor produccion:");
switch(diap)
{
case 1: Console.WriteLine("dia 1");
break;
case 2: Console.WriteLine("dia 2");
break;
case 3: Console.WriteLine("dia 3");
break;
case 4: Console.WriteLine("dia 4");
break;
case 5: Console.WriteLine("dia 5");
break;
case 6: Console.WriteLine("sabado 6");
break;
case 7: Console.WriteLine("Domingo 7");
break;
}
Console.WriteLine("Mayor Produccion en un dia {0}",mayor);
Console.ReadKey();
}
}
}
int suma = 0, mayor = 0, np = 0, diap = 0;
int r, c;
string plantas[12];
int[,] produccion[13, 8];
for (r = 0; r < 12; r++)
{
Print "Nombre Planta",r+1
Read plantas [r]
suma=0;
for (c = 0; c < 7; c++)
{
Print "Producto de la planta", r + 1)
Print "Dia”, c + 1
Read produccion[r, c]
suma = suma + produccion[r, c];
}
produccion[r, 7] = suma;
}
for (c = 0; c < 7; c++)
{
suma = 0;
for (r = 0; r < 11; r++)
{
suma = suma + produccion[r, c];
}
produccion[12, c] = suma;
}
for (r = 0; r < 11; r++)
{
if (produccion[r, 7] > mayor)
{
mayor = produccion[r, 7];
np = r + 1;
}
}
Print "Plantas mas productivas ", np + 1
Print "Produccion de la pantal mas productiva ", produccion[np, 7]
mayor = 0;
for (c = 0; c < 8; c++)
{
if (produccion[12, c] > mayor)
{
mayor = produccion[12, c];
diap = c + 1;
}
}
Print "Dia con mayor produccion:"
switch(diap)
{
case 1: print "dia 1"
break;
case 2: print "dia 2"
break;
case 3: print "dia 3"
break;
case 4: print "dia 4"
break;
case 5: print "dia 5"
break;
case 6: print "Sabado"
break;
case 7: print "Domingo"
break;
}
Print "Mayor Produccion en un dia", mayor
FIN

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int suma = 0, mayor = 0, np=0, diap=0;
int r, c;
string []plantas= new string [12];
int [,] produccion= new int [13,8];
for (r = 0; r < 12; r++)
{
Console.WriteLine("Nombre Planta {0}",r+1);
plantas [r]= Console.ReadLine();
suma=0;
for (c = 0; c < 7; c++)
{
Console.WriteLine("Producto de la planta {0}",r+1);
Console.WriteLine("Dia {0}", c+1);
produccion [r,c]= int.Parse(Console.ReadLine());
suma=suma+produccion[r,c];
}
produccion [r,7]=suma;
}
for(c = 0; c < 7; c++)
{
suma=0;
for(r = 0; r < 11; r++)
{
suma=suma+produccion[r,c];
}
produccion[12,c]=suma;
}
for(r = 0; r < 11; r++)
{
if (produccion[r,7]>mayor)
{
mayor=produccion[r,7];
np=r+1;
}
}
Console.WriteLine("Plantas mas productivas {0}", np+1);
Console.WriteLine("Produccion de la pantal mas productiva {0}",produccion[np,7]);
mayor=0;
for(c = 0; c < 8; c++)
{
if(produccion[12,c]>mayor)
{
mayor=produccion[12,c];
diap=c+1;
}
}
Console.WriteLine("Dia con mayor produccion:");
switch(diap)
{
case 1: Console.WriteLine("dia 1");
break;
case 2: Console.WriteLine("dia 2");
break;
case 3: Console.WriteLine("dia 3");
break;
case 4: Console.WriteLine("dia 4");
break;
case 5: Console.WriteLine("dia 5");
break;
case 6: Console.WriteLine("sabado 6");
break;
case 7: Console.WriteLine("Domingo 7");
break;
}
Console.WriteLine("Mayor Produccion en un dia {0}",mayor);
Console.ReadKey();
}
}
}
PRACTICA 13.1 CLASE LLAMADA RECTANGULO. (consola)

PSEUDOCODIGO:
double ancho, largo;
public rectangulo()
{
ancho = 0;
largo = 0;
}
public void Asignardatos(float w,float h)
{
ancho=w;
largo=h;
}
public void Asignarancho(float w)
{ancho=w;
}
public void Asignarlargo(float h)
{
largo=h;
}
public double Obtenerancho()
{
return ancho;
}
public double Obtenerlargo()
{
return largo;
}
public double Area()
{
return largo*ancho;
}
public double Perimetro()
{
return 2*(largo+ancho);
}
class Program
{
static void Main(string[] args)
{
rectangulo r1 = new rectangulo();
r1.Asignardatos(20,10);
Print r1.Area()
Print r1.Perimetro
rectangulo r2 = new rectangulo();
double l1, l2;
Print("Introduce largo de un rectangulo ");
l1 = double.Parse(Console.ReadLine());
r2.Asignarlargo(l1);
Print ("Introduce ancho de un rectangulo ");
l2 = double.Parse(Console.ReadLine());
r2.Asignarancho(l2);
Print REctangulo 2
Print largo
Print Ancho
Print Area
PRint Perimetro
Console.ReadLine()
..............................................................................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class rectangulo
{
double ancho, largo;
public rectangulo()
{
ancho = 0;
largo = 0;
}
public void Asignardatos(double w,double h)
{
ancho=w;
largo=h;
}
public void Asignarancho(double w)
{
ancho=w;
}
public void Asignarlargo(double h)
{
largo=h;
}
public double Obtenerancho()
{
return ancho;
}
public double Obtenerlargo()
{
return largo;
}
public double Area()
{
return largo*ancho;
}
public double Perimetro()
{
return 2*(largo+ancho);
}
}
}
.........................................................................................................
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
rectangulo r1 = new rectangulo();
r1.Asignardatos(20,10);
Console.WriteLine("AREA= {0}", r1.Area());
Console.WriteLine("PERIMETRO= {0}", r1.Perimetro());
rectangulo r2 = new rectangulo();
double l1, l2;
Console.Write("INTRODUCE LARGO DEL RECTANGULO. ");
l1 = double.Parse(Console.ReadLine());
r2.Asignarlargo(l1);
Console.Write("INTRODUCE ANCHO DE RECATANGULO. ");
l2 = double.Parse(Console.ReadLine());
r2.Asignarancho(l2);
Console.WriteLine("REACTANGULO 2");
Console.WriteLine("\nLARGO= {0}\tANCHO={1}", r2.Obtenerlargo(), r2.Obtenerancho());
Console.WriteLine("AREA= {0}", r2.Area());
Console.WriteLine("PREIMETRO = {0}", r2.Perimetro());
Console.ReadLine();
}
}
}
PRACTICA 13. 2 CLASE LLAMADA ESTUDIANTE( consola )
PSEUDOCODIGO:
int IDE;
double[] CALIF;
int TOTAL;
public estudiante()
{
IDE=0; CALIF=new FLOAT[5];
TOTAL=0;
}
public void introduceide(int nc)
{
IDE=c;
}
public void introducecalif(FLOAT nota)
{
calif[total]=nota;
total++;
}
public FLOAT promedio()
{
double SUMA=0.0f;
int i;
for i=0 step TOTAL i=i+1
{
suma=SUMA+CALIF[i];
}
return SUMA/TOTAL;
}
public int mostraride()
{
return IDE;
}
static void Main(string[] args)
{
int c = 0, MOSTRADOR = 0,nocontrol;
FLOAT EXAMEN;
estudiante e1 = new estudiante();
do
{
PRINT("introduce identificacion estudiante;");
nocontrol = int.Parse(Console.ReadLine());
e1.introduceide(nocontrol);
PRINT("\nIntroduce calificacion (<=5)");
c = int.Parse(Console.ReadLine());
for (int i = 0; i <>
{
PRINT("introduce calificacion {0} EXAMEN;", i + 1)
PRINT EXAMEN
e1.introducecalif(examen);
}
PRINT("identificacion alumno ="+ e1.mostraride());
PRINT("Promedio =" + e1.promedio());
PRINT("presione 1 para registar otro estudiante y 0 para salir ");
MOSTRADOR= int.Parse(Console.ReadLine());
} while (MOSTRADOR== 1);
FIN
}
} }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{ class estudiante
{ int IDE;
double[ ] CALIF
; int TOTAL;
public estudiante()
{
IDE = 0;
CALIF = new double[5];
TOTAL = 0;
}
public void introduceide(int nc)
{
IDE = nc;
}
public void introducecalif(double nota)
{ CALIF[TOTAL] = nota; TOTAL++;
}
public double promedio()
{ double SUMA=0.0f;
int I;
for(I=0;I < {
SUMA=SUMA+CALIF[I];
}
return SUMA/TOTAL;
}
public int mostraride()
{ return IDE;
}
static void Main(string[] args)
{ i
nt c = 0, MOSTRADOR = 0, NOCONTROL;
double EXAMEN;
estudiante E1 = new estudiante();
do {
Console.Write("NTRODUCE IDE DE ESTUDIANTE ......;");
NOCONTROL = int.Parse(Console.ReadLine());
E1.introduceide(NOCONTROL);
Console.Write(" INTRODUCE CALIFICACION (<=5)");
c = int.Parse(Console.ReadLine());
for (int I = 0; I<>
{
Console.Write("INTRODUCE CALIFICACION {0} EXAMEN;", I + 1);
EXAMEN = double.Parse(Console.ReadLine());
E1.introducecalif(EXAMEN);
}
Console.WriteLine("\n IDE DE ALUMNO =" + E1.mostraride());
Console.Write("\n PROMEDIO=" + E1.promedio());
Console.WriteLine("PRESIONA 1 PARA SEGUIR REGISTRANDO Y 0 SALIR ");
MOSTRADOR= int.Parse(Console.ReadLine());
} while (MOSTRADOR == 1);
Console.ReadKey()
} } }
int IDE;
double[] CALIF;
int TOTAL;
public estudiante()
{
IDE=0; CALIF=new FLOAT[5];
TOTAL=0;
}
public void introduceide(int nc)
{
IDE=c;
}
public void introducecalif(FLOAT nota)
{
calif[total]=nota;
total++;
}
public FLOAT promedio()
{
double SUMA=0.0f;
int i;
for i=0 step TOTAL i=i+1
{
suma=SUMA+CALIF[i];
}
return SUMA/TOTAL;
}
public int mostraride()
{
return IDE;
}
static void Main(string[] args)
{
int c = 0, MOSTRADOR = 0,nocontrol;
FLOAT EXAMEN;
estudiante e1 = new estudiante();
do
{
PRINT("introduce identificacion estudiante;");
nocontrol = int.Parse(Console.ReadLine());
e1.introduceide(nocontrol);
PRINT("\nIntroduce calificacion (<=5)");
c = int.Parse(Console.ReadLine());
for (int i = 0; i <>
{
PRINT("introduce calificacion {0} EXAMEN;", i + 1)
PRINT EXAMEN
e1.introducecalif(examen);
}
PRINT("identificacion alumno ="+ e1.mostraride());
PRINT("Promedio =" + e1.promedio());
PRINT("presione 1 para registar otro estudiante y 0 para salir ");
MOSTRADOR= int.Parse(Console.ReadLine());
} while (MOSTRADOR== 1);
FIN
}
} }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{ class estudiante
{ int IDE;
double[ ] CALIF
; int TOTAL;
public estudiante()
{
IDE = 0;
CALIF = new double[5];
TOTAL = 0;
}
public void introduceide(int nc)
{
IDE = nc;
}
public void introducecalif(double nota)
{ CALIF[TOTAL] = nota; TOTAL++;
}
public double promedio()
{ double SUMA=0.0f;
int I;
for(I=0;I
SUMA=SUMA+CALIF[I];
}
return SUMA/TOTAL;
}
public int mostraride()
{ return IDE;
}
static void Main(string[] args)
{ i
nt c = 0, MOSTRADOR = 0, NOCONTROL;
double EXAMEN;
estudiante E1 = new estudiante();
do {
Console.Write("NTRODUCE IDE DE ESTUDIANTE ......;");
NOCONTROL = int.Parse(Console.ReadLine());
E1.introduceide(NOCONTROL);
Console.Write(" INTRODUCE CALIFICACION (<=5)");
c = int.Parse(Console.ReadLine());
for (int I = 0; I<>
{
Console.Write("INTRODUCE CALIFICACION {0} EXAMEN;", I + 1);
EXAMEN = double.Parse(Console.ReadLine());
E1.introducecalif(EXAMEN);
}
Console.WriteLine("\n IDE DE ALUMNO =" + E1.mostraride());
Console.Write("\n PROMEDIO=" + E1.promedio());
Console.WriteLine("PRESIONA 1 PARA SEGUIR REGISTRANDO Y 0 SALIR ");
MOSTRADOR= int.Parse(Console.ReadLine());
} while (MOSTRADOR == 1);
Console.ReadKey()
} } }
PRACTICA 11. 1 VALOR MAXIMO ARREGLO BIDIMENSIONAL(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 posc, posr, mayor;
int r, c;
int[,] numeros = { { 16, 22, 99, 4, 18 }, { -258, 4, 101, 5, 98 }, { 105, 6, 15, 2, 45 }, { 33, 88, 72, 16, 3 } };
public Form1()
{
InitializeComponent();
posc = posr = mayor = 0;
listBox1.Items.Add("los elementos de la matriz son :");
}
private void button1_Click(object sender, EventArgs e)
{
for (r = 0; r <= 3; r++)
{
for (c = 0; c <= 4; c++)
{
if (numeros[r, c] > mayor)
{
mayor = numeros[r, c];
posc = c + 1;
posr = r + 1;
}
else
{
}
listBox1.Items.Add("en el renglon:" + "\t" + posr + "\t" + "en la columna" + "\t" + posc + "\t" + "el numero" +"\t"+ numeros[r, c]);
}
}
listBox1.Items.Add("el dato mayor en el arrego es:" + mayor);
listBox1.Items.Add("en el renglon:"+"\t" + posr);
listBox1.Items.Add("en la columna:" + "\t" + posc);
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
20091214
PRACTICA 11. 3 ACCIDENTES ,CALLES ( 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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
int[,] ciudad = new int[10, 29];
int ave, calle, ac, mayor, mayor2, mayor3, posave, poscalle, posave2, poscalle2, posave3, poscalle3;
public Form1()
{
InitializeComponent();
mayor = mayor2 = mayor3 = posave = poscalle = posave2 = poscalle2 = posave3 = poscalle3 = 0;
button1.Enabled=true;
}
private void button1_Click(object sender, EventArgs e)
{
ave = int.Parse(textBox1.Text);
calle = int.Parse(textBox2.Text);
ac = int.Parse(textBox3.Text);
if ((button1.Enabled== true))
{
if (ave <> 10)
{
MessageBox.Show("avenida equivocada");
textBox1.Clear();
textBox3.Clear();
}
else
{
if (calle <> 58)
{
MessageBox.Show("calle equivocada");
textBox2.Clear();
textBox3.Clear();
}
else
{
if (ac > mayor)
{
ciudad[ave - 1, calle - 30] = ac;
mayor = ac;
posave = ave;
poscalle = calle;
}
else
{
if (ac > mayor2)
{
ciudad[ave - 1, calle - 30] = ac;
mayor2 = ac;
posave2 = ave;
poscalle2 = calle;
}
if (ac > mayor3)
{
ciudad[ave - 1, calle - 30] = ac;
mayor3 = ac;
posave3 = ave;
poscalle3 = calle;
}
else
{
}
}
}
}
listBox1.Items.Add("AC posicion de avenida posicion de calle" );
listBox1.Items.Add(mayor.ToString() +"\t\t"+ posave.ToString() +"\t\t" +poscalle.ToString());
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
else
{
button1.Enabled = false;
if (ave <> 10)
{
MessageBox.Show("avenida equivocada");
textBox1.Clear();
textBox3.Clear();
}
else
{
if (calle <> 58)
{
MessageBox.Show("calle equivocada");
textBox2.Clear();
textBox3.Clear();
}
else
{
if (ac > mayor)
{
ac = int.Parse(textBox3.Text);
ciudad[ave - 1, calle - 30] = ac;
mayor = ac;
posave = ave;
poscalle = calle;
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
else
{
if (ac > mayor2)
{
ac = int.Parse(textBox3.Text);
ciudad[ave - 1, calle - 30] = ac;
mayor2 = ac;
posave2 = ave;
poscalle2 = calle;
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
else
{
if (ac <>
{
ciudad[ave - 1, calle - 30] = ac;
mayor3 = ac;
posave3 = ave;
poscalle3 = calle;
}
else
{
}
}
}
}
}
}
}
private void button2_Click_1(object sender, EventArgs e)
{
listBox1.Items.Add("entre la ave " + posave + " y la calle " + poscalle + " se produce la > cantidad de accidentes con:" + mayor);
listBox1.Items.Add("entrela av " + posave2 + " y la calle " + poscalle2 + " se produce la 2da > cantidad de accidentes con:" + mayor2);
listBox1.Items.Add("entre la av " + posave3 + " y la calle " + poscalle3 + " se produce la 3ra > cantidad de accidentes con:" + mayor3);
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
listBox1.Items.Clear();
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
20091213
PRACTICA 11.2 VENDEDORES (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 WindowsFormsApplication3
{
public partial class Form1 : Form
{
double[,] sueldos = new double[10, 15];
double[] Precio = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
int RS, ATC, C;
public Form1()
{
InitializeComponent();
listBox1.Items.Add("Vendedor Articulo Cantidad ");
RS = ATC = C = 0;
}
private void button1_Click(object sender, EventArgs e)
{
RS = int.Parse(textBox1.Text);
textBox1.Clear();
ATC = int.Parse(textBox2.Text);
textBox2.Clear();
C = int.Parse(textBox3.Text);
textBox3.Clear();
listBox1.Items.Add(RS.ToString() + "\t" + ATC.ToString() + "\t" + C.ToString());
sueldos[RS - 1, ATC - 1] = sueldos[RS - 1, ATC - 1] + C * Precio[ATC - 1];
}
private void button2_Click_1(object sender, EventArgs e)
{
int V, P;
double SUM, salario;
for (V = 0; V < v =" V">
{
SUM = 0;
for (P = 0; P < p =" P">
{
SUM = SUM + sueldos[V, P];
}
salario = SUM * 0.05;
listBox1.Items.Add("Vendedor Sueldo");
listBox1.Items.Add("\t" +V.ToString()+"\t" + salario.ToString());
}
}
private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
Publicar entrada
}
}
PRACTICA 11.4 ESCIONES DE TRABAJO (cosnsola).
pseudocodigo.
string[] enc = new string[15];
int[,] prod = new int[15, 13];
int i,m,p;
int mayor = 0
int pos=0
int suma = 0
string encargado
int sumatotal = 0;
for (i = 0; i < i =" 0;" m =" 0;" suma =" suma">Print "Analisis de produccion"
Print " la sumatotal de: \t total de produccion"
for (i=0 ; i<15 sumatotal="sumatotal">Print("",enc[i], sumatotal);
if (prod[i, 12] > mayor)
{
mayor = prod[i, 12];
pos = i+1;
encargado = enc[i];
}
else
{
}
}
Print("el total de produccion de todas las estaciones en el año es{0}:",sumatotal);
Print "la estacion mas productiva fue:",pos
Print "el engargado es:", encargado
Print "con la cantidad de:", mayor
fin.
ESTACIONES DE TRABAJO.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string[] enc = new string[15];
int[,] prod = new int[15, 13];
int i,m,p;
int mayor = 0;
int pos=0;
int suma = 0;
string encargado;
encargado = Console.ReadLine();
int sumatotal = 0;
for (i = 0; i < i =" 0;" m =" 0;" p =" int.Parse(Console.ReadLine());" suma =" suma" i="0" sumatotal="sumatotal"> mayor)
{
mayor = prod[i, 12];
pos = i+1;
encargado = enc[i];
}
else
{
}
}
Console.WriteLine("el total de produccion de todas las estaciones en el año es{0}:",sumatotal);
Console.WriteLine("la estacion mas productiva fue:{0}",pos);
Console.WriteLine("el engargado es:{0}", encargado);
Console.WriteLine("con la cantidad de:{0}", mayor);
Console.ReadKey();
}
}
}
string[] enc = new string[15];
int[,] prod = new int[15, 13];
int i,m,p;
int mayor = 0
int pos=0
int suma = 0
string encargado
int sumatotal = 0;
for (i = 0; i < i =" 0;" m =" 0;" suma =" suma">Print "Analisis de produccion"
Print " la sumatotal de: \t total de produccion"
for (i=0 ; i<15 sumatotal="sumatotal">Print("",enc[i], sumatotal);
if (prod[i, 12] > mayor)
{
mayor = prod[i, 12];
pos = i+1;
encargado = enc[i];
}
else
{
}
}
Print("el total de produccion de todas las estaciones en el año es{0}:",sumatotal);
Print "la estacion mas productiva fue:",pos
Print "el engargado es:", encargado
Print "con la cantidad de:", mayor
fin.
ESTACIONES DE TRABAJO.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string[] enc = new string[15];
int[,] prod = new int[15, 13];
int i,m,p;
int mayor = 0;
int pos=0;
int suma = 0;
string encargado;
encargado = Console.ReadLine();
int sumatotal = 0;
for (i = 0; i < i =" 0;" m =" 0;" p =" int.Parse(Console.ReadLine());" suma =" suma" i="0" sumatotal="sumatotal"> mayor)
{
mayor = prod[i, 12];
pos = i+1;
encargado = enc[i];
}
else
{
}
}
Console.WriteLine("el total de produccion de todas las estaciones en el año es{0}:",sumatotal);
Console.WriteLine("la estacion mas productiva fue:{0}",pos);
Console.WriteLine("el engargado es:{0}", encargado);
Console.WriteLine("con la cantidad de:{0}", mayor);
Console.ReadKey();
}
}
}
20091211
PRACTICA 11.2 VENDEDORES (consola)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double[,] sueldos = new double[10, 15];
double[] precio = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
int Nv, Art, N, sigue = 1;
do
{
Console.WriteLine("No DE VENDEDOR:");
Nv = int.Parse(Console.ReadLine());
Console.WriteLine("No DE ARTICULO:");
Art = int.Parse(Console.ReadLine());
Console.WriteLine("CANTIDAD DE ARTICULO:");
N = int.Parse(Console.ReadLine());
sueldos[Nv - 1, Art - 1] = sueldos[Nv - 1, Art - 1] + N * precio[Art - 1];
Console.WriteLine("PRECIONE 1 PARA CONTINUAR 0 PARA CALCULAR SUELDOS");
sigue = int.Parse(Console.ReadLine());
}
while (sigue == 1);
{
int v, p;
double sum, salario;
for (v = 0; v < v =" v">
{
sum = 0;
for (p = 0; p < p =" p">
{
sum = sum + sueldos[v, p];
}
salario = sum * 0.05;
Console.WriteLine("No DE VENDEDOR:{0}", v + 1);
Console.WriteLine("SUELDO:{0}", salario);
}
}
Console.ReadKey();
}
}
}
PRACTICA 11. 3 ACCIDENTES,CALLES (consola)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int[,] ciudad = new int[10, 29];
int ave, calle, a, c, sigue, ac, mayor = 0, mayor2 = 0, mayor3 = 0;
int posave = 0, posave2 = 0, posave3 = 0;
int poscalle = 0, poscalle2 = 0, poscalle3 = 0;
do
{
do
{
Console.WriteLine("INTRODUCE No DE LA AVENIDA");
ave = int.Parse(Console.ReadLine());
if (ave <> 10)
{
Console.WriteLine("AVENIDA INCORRECTA");
}
}
while (ave <> 10);
do
{
Console.WriteLine("INTRODUCE NUEMERO DE CALLE");
calle = int.Parse(Console.ReadLine());
if (calle <> 58)
{
Console.WriteLine("CALLE INCORRECTA");
}
}
while (calle <> 58);
Console.WriteLine("No DE ACCIDENTES");
ac = int.Parse(Console.ReadLine());
ciudad[ave - 1, calle - 30] = ac;
Console.WriteLine("PRESIONE 1 PARA SEGUIR Y 0 PARA TERMINAR");
sigue = int.Parse(Console.ReadLine());
}
while (sigue == 1);
for (a = 0; a <= 9; a++)
{
for (c = 0; c <= 28; c++)
{
if (ciudad[a, c] > mayor)
{
mayor = ciudad[a, c];
posave = a + 1;
poscalle = c + 30;
}
else
{
if (ciudad[a, c] > mayor2)
{
mayor2 = ciudad[a, c];
posave2 = a + 1;
poscalle2 = c + 30;
}
else
{
if (ciudad[a, c] > mayor3)
{
mayor3 = ciudad[a, c];
poscalle3 = c + 30;
posave3 = a + 1;
}
else
{
}
}
}
}
}
Console.WriteLine("la 1er interseccion + peligrosa es / ave {0} y la calle {1} con un numero de accidentes {2}", posave, poscalle, mayor);
Console.WriteLine("la 2da interseccion + peligrosa es / ave {0} y la calle {1} con un numero de accidentes {2}", posave2, poscalle2, mayor2);
Console.WriteLine("la 3ra interseccion + peligrosa es /ave {0} y la calle {1} con un numero de accidentes {2}", posave3, poscalle3, mayor3);
Console.ReadKey();
}
}
}
PRACTICA 11. 1 VALOR MAXIMO ARREGLO BIDIMENSIONAL

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int posc = 0, posr = 0;
int mayor = 0;
int c, r;
int[,] numeros = { { 16, 22, 99, 4, 18 }, { -258, 4, 101, 5, 98 }, { 105, 6, 15, 2, 45, }, { 33, 88, 72, 16, 3 } };
for (r=0;r<3;r++) c =" 0;"> mayor)
{
mayor = numeros[r, c];
posc = c + 1;
posr = r + 1;
}
else
{
}
Console.WriteLine("la matriz conformado por {0}", numeros[r, c]);
}}
Console.WriteLine("el numero mayor es {0}",mayor);
Console.WriteLine("en el renglon {0}",posr);
Console.WriteLine("en la columna {0}",posc);
Console.ReadKey();
}
}
}
20091124
EXTRA UNIDAD 2 (1) PROMEDIOS (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 n;
double prom = 0.0;
int total = 0;
int suma = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (n != 9999)
{
n = int.Parse(textBox1.Text);
listBox1.Items.Add("VALOR NUMERICO " + n.ToString());
suma = suma + n;
total = total + 1;
textBox1.Clear();
}
else
{
prom = suma / total;
listBox1.Items.Add("EL PROMEDIO ES : " + prom.ToString());
textBox1.Enabled = false;
button1.Enabled = false;
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
EXTRA UNIDAD 2 (1) PROMEDIO DE N NUMEROS (consola)
pseudocodigo.
inicio
int n;
double prom = 0.0;
int total = 0;
int suma = 0;
int suma1 = 0;
do
print"INTRODUCE VALOR NUEMRICO"
Read n
suma = suma + n
total = total + 1
}
while n != 9999
{
prom = (suma) / (total);
}
print "ELPROMEDIO RESULTANTE ES" , prom
}
fin

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int n;
double prom = 0.0;
int total = 0;
int suma = 0;
int suma1 = 0;
do
{
Console.WriteLine("INTRODUCE VALOR NUEMRICO");
n = int.Parse(Console.ReadLine());
suma = suma + n;
total = total + 1;
}
while (n != 9999);
{
prom = (suma) / (total);
}
Console.WriteLine("ELPROMEDIO RESULTANTE ES : {0}", prom);
Console.ReadKey();
}
}
}
inicio
int n;
double prom = 0.0;
int total = 0;
int suma = 0;
int suma1 = 0;
do
print"INTRODUCE VALOR NUEMRICO"
Read n
suma = suma + n
total = total + 1
}
while n != 9999
{
prom = (suma) / (total);
}
print "ELPROMEDIO RESULTANTE ES" , prom
}
fin

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int n;
double prom = 0.0;
int total = 0;
int suma = 0;
int suma1 = 0;
do
{
Console.WriteLine("INTRODUCE VALOR NUEMRICO");
n = int.Parse(Console.ReadLine());
suma = suma + n;
total = total + 1;
}
while (n != 9999);
{
prom = (suma) / (total);
}
Console.WriteLine("ELPROMEDIO RESULTANTE ES : {0}", prom);
Console.ReadKey();
}
}
}
20091120
EXTRA UNIDAD 2 (2) NUMEROS ROMANOS (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
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int numero;
numero=int.Parse(textBox1.Text);
switch (numero)
{
case 0: Console.WriteLine("exit");
break;
case 1: textBox2.Text=("su equivalente en romano es I");
break;
case 2: textBox2.Text = ("su equivalente en romano es II");
break;
case 3: textBox2.Text = ("su equivalente en romano es III");
break;
case 4: textBox2.Text = ("su equivalente en romano es IV");
break;
case 5: textBox2.Text = ("su equivalente en romano es V");
break;
case 6: textBox2.Text = ("su equivalente en romano es VI");
break;
case 7: textBox2.Text = ("su equivalente en romano es VII");
break;
case 8: textBox2.Text = ("su equivalente en romano es VIII");
break;
case 9: textBox2.Text = ("su equivalente en romano es IX");
break;
case 10: textBox2.Text = ("su equivalente en romano es X");
break;
default: Console.WriteLine("No Se introdujo numero correcto");
break;
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
EXTRA UNIDAD 2 (2) NUMEROS ROMANOS
pseudocodigo.
inicio
do
{
print("IINTRODUCE VALOR ENTERO 1-10 Y 0 PARA SALIR" )
Read numero
switch(numero)
{
case 0:Console.WriteLine("EXIT" ); break;
case 1: print("SU EQUIVALENTE EN NUMERO ROMANO ES I") break;
case 2: print("SU EQUIVALENTE EN NUMERO ROMANO ES II") break;
case 3: print("SU EQUIVALENTE EN NUMERO ROMANO ES III") break;
case 4: print("SU EQUIVALENTE EN NUMERO ROMANO ES IV") break;
case 5: print("SU EQUIVALENTE EN NUMERO ROMANO ES V") break;
case 6: print("SU EQUIVALENTE EN NUMERO ROMANO ES VI") break;
case 7:print("SU EQUIVALENTE EN NUMERO ROMANO ES VII") break;
case 8: print("SU EQUIVALENTE EN NUMERO ROMANO ES VIII") break;
case 9:print("SU EQUIVALENTE EN NUMERO ROMANO ES IX");break;
case 10: print("SU EQUIVALENTE EN NUMERO ROMANO ES X") break;
default :print("error" ) break
}
}
while (numero != 0);
fin.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int numero ;
do
{
Console.WriteLine("IINTRODUCE VALOR ENTERO 1-10 Y 0 PARA SALIR" );
numero = int.Parse(Console.ReadLine());
switch(numero)
{
case 0:Console.WriteLine("EXIT" );
break;
case 1: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES I");
break;
case 2: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES II");
break;
case 3: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES III");
break;
case 4: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES IV");
break;
case 5: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES V");
break;
case 6: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES VI");
break;
case 7: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES VII");
break;
case 8: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES VIII");
break;
case 9: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES IX");
break;
case 10: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES X");
break;
default :Console.WriteLine("error" );
break;
}
}
while (numero != 0);
Console.ReadKey();
}
}
}
inicio
do
{
print("IINTRODUCE VALOR ENTERO 1-10 Y 0 PARA SALIR" )
Read numero
switch(numero)
{
case 0:Console.WriteLine("EXIT" ); break;
case 1: print("SU EQUIVALENTE EN NUMERO ROMANO ES I") break;
case 2: print("SU EQUIVALENTE EN NUMERO ROMANO ES II") break;
case 3: print("SU EQUIVALENTE EN NUMERO ROMANO ES III") break;
case 4: print("SU EQUIVALENTE EN NUMERO ROMANO ES IV") break;
case 5: print("SU EQUIVALENTE EN NUMERO ROMANO ES V") break;
case 6: print("SU EQUIVALENTE EN NUMERO ROMANO ES VI") break;
case 7:print("SU EQUIVALENTE EN NUMERO ROMANO ES VII") break;
case 8: print("SU EQUIVALENTE EN NUMERO ROMANO ES VIII") break;
case 9:print("SU EQUIVALENTE EN NUMERO ROMANO ES IX");break;
case 10: print("SU EQUIVALENTE EN NUMERO ROMANO ES X") break;
default :print("error" ) break
}
}
while (numero != 0);
fin.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int numero ;
do
{
Console.WriteLine("IINTRODUCE VALOR ENTERO 1-10 Y 0 PARA SALIR" );
numero = int.Parse(Console.ReadLine());
switch(numero)
{
case 0:Console.WriteLine("EXIT" );
break;
case 1: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES I");
break;
case 2: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES II");
break;
case 3: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES III");
break;
case 4: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES IV");
break;
case 5: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES V");
break;
case 6: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES VI");
break;
case 7: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES VII");
break;
case 8: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES VIII");
break;
case 9: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES IX");
break;
case 10: Console.WriteLine("SU EQUIVALENTE EN NUMERO ROMANO ES X");
break;
default :Console.WriteLine("error" );
break;
}
}
while (numero != 0);
Console.ReadKey();
}
}
}
EXTRA UNIDAD 2 (3) PESOS DE LA PESCA (visual)
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 lim, peso, sum;
public Form1()
{
InitializeComponent();
sum = 0;
}
private void button2_Click(object sender, EventArgs e)
{
peso = double.Parse(textBox2.Text);
if (sum <>
{
sum = sum + peso;
listBox1.Items.Add("" + peso.ToString());
if (sum > lim)
{
listBox1.Items.Add("El limite ha excedido");
listBox1.Items.Add("EL PESO TOTAL ES " + sum.ToString());
}
if (sum == lim)
{
listBox1.Items.Add("ha llegado al limite");
listBox1.Items.Add("EL PESO TOTAL ES " + sum.ToString());
}
textBox2.Clear();
textBox2.Focus();
}
else
{
textBox2.Enabled = false;
button2.Enabled = false;
}
}
private void button5_Click(object sender, EventArgs e)
{
lim = double.Parse(textBox1.Text);
listBox1.Items.Add("Peso Individual");
textBox1.Enabled = false;
button5.Enabled = false;
textBox2.Focus();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
listBox1.Items.Clear();
button5.Enabled=true;
textBox1.Enabled = true;
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
}
}
{
listBox1.Items.Add("El limite ha excedido");
listBox1.Items.Add("EL PESO TOTAL ES " + sum.ToString());
}
if (sum == lim)
{
listBox1.Items.Add("ha llegado al limite");
listBox1.Items.Add("EL PESO TOTAL ES " + sum.ToString());
}
textBox2.Clear();
textBox2.Focus();
}
else
{
textBox2.Enabled = false;
button2.Enabled = false;
}
}
private void button5_Click(object sender, EventArgs e)
{
lim = double.Parse(textBox1.Text);
listBox1.Items.Add("Peso Individual");
textBox1.Enabled = false;
button5.Enabled = false;
textBox2.Focus();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
listBox1.Items.Clear();
button5.Enabled=true;
textBox1.Enabled = true;
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
}
}
EXTRA UNIDAD 2 (3) PESOS DE LA PESCA
pseudocodigo.
inicio
double lim, peso, sum;
sum = 0;
print "INTRODUCE EL LIMITE DE LA PESCA: "
Read lim
do
{
print "INTRODUCE EL PESO INDIVIDUAL: "
peso = double.Parse(Console.ReadLine());
sum = sum + peso;
if (sum > lim)
{
print "EL LIMITE HA EXCEDIDO"
print "EL PESO TOTAL ES ", sum
}
if (sum == lim)
{
print "HA LLEGADO AL LIMITE"
print("EL PESO TOTAL ES ", sum)

inicio
double lim, peso, sum;
sum = 0;
print "INTRODUCE EL LIMITE DE LA PESCA: "
Read lim
do
{
print "INTRODUCE EL PESO INDIVIDUAL: "
peso = double.Parse(Console.ReadLine());
sum = sum + peso;
if (sum > lim)
{
print "EL LIMITE HA EXCEDIDO"
print "EL PESO TOTAL ES ", sum
}
if (sum == lim)
{
print "HA LLEGADO AL LIMITE"
print("EL PESO TOTAL ES ", sum)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double lim, peso, sum;
sum = 0;
Console.Write("INTRODUCE EL LIMITE DE LA PESCA: ");
lim = double.Parse(Console.ReadLine());
do
{
Console.Write("INTRODUCE EL PESO INDIVIDUAL: ");
peso = double.Parse(Console.ReadLine());
sum = sum + peso;
if (sum > lim)
{
Console.WriteLine("EL LIMITE HA EXCEDIDO");
Console.WriteLine("EL PESO TOTAL ES {0}", sum);
}
if (sum == lim)
{
Console.WriteLine("HA LLEGADO AL LIMITE");
Console.WriteLine("EL PESO TOTAL ES {0}", sum);
}
}
while (sum < lim && peso != 0);
Console.ReadLine();
}
}
}
20091117
PRACTICA 10.3 ARREGLO BIDIMENSIONAL(consola,visual)
Pseudocodigo.
REAL[,] voltajes=new double[3,5];
REAL c1 =0,c2=0,r=0,c=0,suma1=0,suma2=0;
for (r = 0 TO 3 r=r+1)
{
for (c = 0 TO 5; c= c+1)
{
PRINT "Voltajes [{0},{1}] : ", r, c
READ voltajes[r, c]
}
}
for (r = 0 TO 3; r=r+1)
{
for (c = 0 TO 5; c=c+1)
{
if (voltajes[r, c] < 60)
{
c1 = c1 + 1;
}
else
{
if (voltajes[r, c] >= 60)
{
c2 = c2 + 1;
}
}
}
}
PRINT "No. de Voltajes <60>=60 : {1}", c1,c2);
final .

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double[,] voltajes = new double[3, 5];
int SUMA1 = 0, SUMA2 = 0, r = 0, c = 0;
for (r = 0; r < 3; r++)
{ for (c = 0; c < 5; c++)
{ Console.Write("Voltajes [{0},{1}] : ", r, c);
voltajes[r, c] = double.Parse(Console.ReadLine());
} }
for (r = 0; r < 3; r++)
{ for (c = 0; c < 5; c++)
{ if (voltajes[r, c] < 60)
{ SUMA1 = SUMA1 + 1;
} else { if (voltajes[r, c] >= 60)
{
SUMA2 = SUMA2 + 1;
}}}}
Console.WriteLine("\n VOLTAJES MENORES DE 60 : {0}\n\n VOLTJES MAYORES DE 60 : {1}", SUMA1, SUMA2);
Console.ReadKey();
}
}
}
PRACTICA 10.3 ARREGLO BIDIMENSIONAL. (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[,] voltaje = new int[3, 5];
int resistencia = 0;
int corriente = 0;
int c1 = 0, c2 = 0;
public Form1()
{
InitializeComponent();
listBox1.Items.Add("");
}
private void button1_Click(object sender, EventArgs e)
{if (resistencia < 3)
{ if (corriente < 5)
{ voltaje[resistencia, corriente] = int.Parse(textBox1.Text);
listBox1.Items.Add("Voltaje [" + resistencia.ToString() + "," + corriente.ToString() + "] : " + voltaje[resistencia, corriente].ToString());
corriente++;
textBox1.Clear();
}
else
{
resistencia++;
corriente = 0;
}
}
}
private void button2_Click_1(object sender, EventArgs e)
{
for (resistencia = 0; resistencia < 3; resistencia++)
{
for (corriente = 0; corriente < 5; corriente++)
{
if (voltaje[resistencia, corriente] < 60)
{
c1 = c1 + 1;
}
else
{if (voltaje[resistencia, corriente] >= 60)
{
c2 = c2 + 1;
}
}
}
}
textBox2.Text = ("Numero de Voltajes <60 es: " + c1.ToString());
textBox3.Text = ("Numero de Voltases >=60 es: " + c2.ToString());
}
private void button3_Click_1(object sender, EventArgs e)
{ textBox1.Clear();
listBox1.Items.Clear();
textBox2.Clear();
textBox3.Clear();
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
}
}
REAL[,] voltajes=new double[3,5];
REAL c1 =0,c2=0,r=0,c=0,suma1=0,suma2=0;
for (r = 0 TO 3 r=r+1)
{
for (c = 0 TO 5; c= c+1)
{
PRINT "Voltajes [{0},{1}] : ", r, c
READ voltajes[r, c]
}
}
for (r = 0 TO 3; r=r+1)
{
for (c = 0 TO 5; c=c+1)
{
if (voltajes[r, c] < 60)
{
c1 = c1 + 1;
}
else
{
if (voltajes[r, c] >= 60)
{
c2 = c2 + 1;
}
}
}
}
PRINT "No. de Voltajes <60>=60 : {1}", c1,c2);
final .

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double[,] voltajes = new double[3, 5];
int SUMA1 = 0, SUMA2 = 0, r = 0, c = 0;
for (r = 0; r < 3; r++)
{ for (c = 0; c < 5; c++)
{ Console.Write("Voltajes [{0},{1}] : ", r, c);
voltajes[r, c] = double.Parse(Console.ReadLine());
} }
for (r = 0; r < 3; r++)
{ for (c = 0; c < 5; c++)
{ if (voltajes[r, c] < 60)
{ SUMA1 = SUMA1 + 1;
} else { if (voltajes[r, c] >= 60)
{
SUMA2 = SUMA2 + 1;
}}}}
Console.WriteLine("\n VOLTAJES MENORES DE 60 : {0}\n\n VOLTJES MAYORES DE 60 : {1}", SUMA1, SUMA2);
Console.ReadKey();
}
}
}
PRACTICA 10.3 ARREGLO BIDIMENSIONAL. (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[,] voltaje = new int[3, 5];
int resistencia = 0;
int corriente = 0;
int c1 = 0, c2 = 0;
public Form1()
{
InitializeComponent();
listBox1.Items.Add("");
}
private void button1_Click(object sender, EventArgs e)
{if (resistencia < 3)
{ if (corriente < 5)
{ voltaje[resistencia, corriente] = int.Parse(textBox1.Text);
listBox1.Items.Add("Voltaje [" + resistencia.ToString() + "," + corriente.ToString() + "] : " + voltaje[resistencia, corriente].ToString());
corriente++;
textBox1.Clear();
}
else
{
resistencia++;
corriente = 0;
}
}
}
private void button2_Click_1(object sender, EventArgs e)
{
for (resistencia = 0; resistencia < 3; resistencia++)
{
for (corriente = 0; corriente < 5; corriente++)
{
if (voltaje[resistencia, corriente] < 60)
{
c1 = c1 + 1;
}
else
{if (voltaje[resistencia, corriente] >= 60)
{
c2 = c2 + 1;
}
}
}
}
textBox2.Text = ("Numero de Voltajes <60 es: " + c1.ToString());
textBox3.Text = ("Numero de Voltases >=60 es: " + c2.ToString());
}
private void button3_Click_1(object sender, EventArgs e)
{ textBox1.Clear();
listBox1.Items.Clear();
textBox2.Clear();
textBox3.Clear();
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
}
}
Suscribirse a:
Entradas (Atom)