viernes, 18 de diciembre de 2009

Examen Clases Visual


class empleados
{int ideempleado;
float pago;
int horas;
public empleados()
{
ideempleado = 0;
pago = 0.0f;
horas = 0;
}
public void asignaride(int noemp)
{
ideempleado = noemp;
}
public void asignarpago(float p)
{ pago = p; }

public void asignarhoras(int h)
{
horas = h;
}
public int obteneride()
{ return ideempleado; }
public float obtenerpago()
{return pago ;}
public int obtenerhoras()
{ return horas; }}
}


public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
empleados E1 = new empleados();
int id, hr;
float p1;

id = int.Parse(textBox1.Text);
E1.asignaride(id);

p1 = float.Parse(textBox2.Text);
E1.asignarpago(p1);


hr = int.Parse(textBox3.Text);
E1.asignarhoras(hr);
listBox1.Items.Add("Empleado 1");
listBox1.Items.Add("No Empleado=" + E1.obteneride() + "Pago Por Hora=" + E1.obtenerpago() + "Horas trabajadas " + E1.obtenerhoras());



}

private void button2_Click(object sender, EventArgs e)
{



empleados E2 = new empleados();
int id, hr;
float p1;

id = int.Parse(textBox1.Text);
E2.asignaride(id);

p1 = float.Parse(textBox2.Text);
E2.asignarpago(p1);


hr = int.Parse(textBox3.Text);
E2.asignarhoras(hr);
listBox2.Items.Add("Empleado 3");
listBox2.Items.Add("No Empleado=" + E2.obteneride() + "Pago Por Hora=" + E2.obtenerpago() + "Horas trabajadas " + E2.obtenerhoras());



}

private void button3_Click(object sender, EventArgs e)
{
empleados E3 = new empleados();

E3.asignaride(432);
E3.asignarpago(21.50f);
E3.asignarhoras(20);
listBox3.Items.Add("Empleado 3");
listBox3.Items.Add("No Empleado=" + E3.obteneride() + "Pago Por Hora=" + E3.obtenerpago() + "Horas trabajadas " + E3.obtenerhoras());

}

private void button4_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
}

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

Examen Clases Consola


class empleado
{int ideempleado;
float pago;
int horas;
public empleado()
{
ideempleado = 0;
pago = 0.0f;
horas = 0;
}
public void asignaride(int noemp)
{
ideempleado = noemp;
}
public void asignarpago(float p)
{ pago = p; }

public void asignarhoras(int h)
{
horas = h;
}
public int obteneride()
{ return ideempleado; }
public float obtenerpago()
{return pago ;}
public int obtenerhoras()
{ return horas; }}
}


class Program
{
static void Main(string[] args)
{
empleado E1 = new empleado();
int id, hr;
float p1;
Console.Write("Identificacion Empleado:");
id = int.Parse(Console.ReadLine());
E1.asignaride(id);
Console.Write("Pago Por Hora:");
p1 = float.Parse(Console.ReadLine());
E1.asignarpago(p1);
Console.Write("Horas Trabajadas:");
hr = int.Parse(Console.ReadLine());
E1.asignarhoras(hr);
Console.WriteLine("No Empleado= {0}, Pago Por Hora= {1}, Horas trabajadas {2}", E1.obteneride(), E1.obtenerpago(), E1.obtenerhoras());




empleado E2 = new empleado();

Console.Write("\t\n Identificacion empleado:");
id = int.Parse(Console.ReadLine());
E2.asignaride(id);
Console.Write("Pago Por Hora:");
p1 = float.Parse(Console.ReadLine());
E2.asignarpago(p1);
Console.Write("Horas Trabajadas");
hr = int.Parse(Console.ReadLine());
E2.asignarhoras(hr);
Console.WriteLine("no empleado= {0},pago por hora= {1},horas trabajadas= {2}", E2.obteneride(), E2.obtenerpago(), E2.obtenerhoras());



empleado E3 = new empleado();
E3.asignaride(432);
E3.asignarpago(21.50f);
E3.asignarhoras(20);

Console.Write("Empleado 3");
Console.WriteLine(" No Empleado= {0}, Pago por hora= {1}, Horas Trabajadas= {2}", E2.obteneride(), E2.obtenerpago(), E2.obtenerhoras());

Console.ReadLine();



}
}
}

jueves, 17 de diciembre de 2009

Practica 13.2 Visual





using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Clase_Estudiante_W
{
public partial class Form1 : Form
{
int C = 0, NOCONTROL=0;
float EXAMEN;

estudiante E1 = new estudiante();
public Form1()
{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)
{
CO.Focus();
NOCONTROL = int.Parse(CO.Text);
E1.INTRODUCEIDE(NOCONTROL);

C = int.Parse(MA.Text);

for(int I=1;I

{

EXAMEN=float.Parse(CA.Text);
E1.INTRODUCECALIFICACION(EXAMEN);
listBox1.Items.Add(EXAMEN);

CA.Clear();
CA.Focus();


}



}

private void button2_Click(object sender, EventArgs e)
{

listBox1.Items.Add("No. Control: " + E1.MOSTRARIDE());
MessageBox.Show("Numero de control : " + E1.MOSTRARIDE() + "\n" + "Promedio : " + E1.PROMEDIO());



}

private void button3_Click(object sender, EventArgs e)
{
CO.Clear();
MA.Clear();
CA.Clear();
listBox1.Items.Clear();
}

private void button4_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}

Practica 13.1 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);

}



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

namespace ConsoleApplication3
{
class rectangulo
{
double ancho;
double largo;



public rectangulo()
{
ancho = 0.0;
largo = 0.0;
}

public rectangulo(double w, double h)
{
ancho = w;
largo = h;
}
public double area()
{
return ancho * largo;
}
public double perimetro()
{
return 2 * (largo + ancho);
}
public void agsinarlargo(double h)
{
largo = h;
}
public void agsinarancho(double w)
{
ancho = w;
}
public double obtenerlargo()
{
return largo;
}
public double obtenerancho()
{
return ancho;
}
}
}


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

namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
double L, A;
rectangulo r1 = new
rectangulo();
Console.WriteLine("\n\t\t\tAREA Y PERIMETRO DE UN RECTANGULO");



Console.WriteLine("\nIntroduce el Largo de un rectangulo");
L = double.Parse(Console.ReadLine());
Console.WriteLine("\nIntroduce el ancho de un rectangulo");
A = double.Parse(Console.ReadLine());
r1.agsinarancho(A);
r1.agsinarlargo(L);

Console.WriteLine("\nArea= {0} ", r1.area());
Console.WriteLine("Perimetro= {0} ", r1.perimetro());
Console.ReadLine();
}
}
}

martes, 15 de diciembre de 2009

Practica 13.1 Visual


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

namespace Practica_13_V
{
class rectangulo
{
double ancho;
double largo;



public rectangulo()
{
ancho = 0.0;
largo = 0.0;
}

public rectangulo(double w, double h)
{
ancho = w;
largo = h;
}
public double area()
{
return ancho * largo;
}
public double perimetro()
{
return 2 * (largo + ancho);
}
public void agsinarlargo(double h)
{
largo = h;
}
public void agsinarancho(double w)
{
ancho = w;
}
public double obtenerlargo()
{
return largo;
}
public double obtenerancho()
{
return 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 Practica_13_V
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
double L, A;
rectangulo r1 = new
rectangulo();
L = double.Parse(LAR.Text);
A = double.Parse(ANCH.Text);
r1.agsinarancho(A);
r1.agsinarlargo(L);

MessageBox.Show("El perimetro es : "+r1.perimetro()+"\n"+"El area es : "+ r1.area());
}

private void button2_Click(object sender, EventArgs e)
{
ANCH.Clear();
LAR.Clear();
}

private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void Form1_Activated(object sender, EventArgs e)
{
LAR.Focus();
}

private void LAR_TextChanged(object sender, EventArgs e)
{

}
}
}

Practica 13.2 Consola


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

namespace ConsoleApplication1
{
class Class_estudiante
{
int IDE;
float [] calif;
int total;
public Class_estudiante ()
{
IDE=0;
calif=new float[5];
total=0;
}
public void introduceIDE(int NC)
{
IDE=NC;
}
public void introducecalif(float Nota)
{
calif[total]=Nota;
total++;
}
public float promedio()
{
float suma=0.0f;
int I;
for (I=0; I
{
suma=suma+calif[I];
}
return suma/total;
}
public int mostrarIDE()
{
return IDE;
}
}
}



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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int C = 0, bandera = 0, Nocontrol;
float examen;
Class_estudiante E1 = new Class_estudiante();
do
{
Console.WriteLine("introduce identificacion de estudiante:");
Nocontrol=int.Parse(Console.ReadLine());
E1.introduceIDE (Nocontrol);
Console.WriteLine("introduce la cantidad de calificaciones (<5):");
C=int.Parse(Console.ReadLine());
for (int I=0; I
{
Console.WriteLine("introduce calificaciones {0} examen:", I+1);
examen=float.Parse(Console.ReadLine());
E1.introducecalif(examen);
}

Console.WriteLine("identificacion alumno={0}",E1.mostrarIDE());
Console.WriteLine("promedio={0}",E1.promedio());
Console.WriteLine("presione 1 para registrar otro estidiante y 0 para salir ");
bandera=int.Parse(Console.ReadLine());
}
while(bandera==1);
Console.ReadLine();
}

lunes, 14 de diciembre de 2009

Practica 12.2 Visual


PSEUDOCODIGO


int N1, N2;
int suma()
{
return N1 + N2;
}
int multiplica()
{
return N1 * N2;
}

{
READ N1
READ N2
int R1 = suma();
int R2 = multiplica();
PRINT "Suma:" + R1
PRINT "Multiplicacion:" + R2

}



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 DATOS_W
{
public partial class Form1 : Form
{
int N1, N2;
int suma()
{
return N1 + N2;
}
int multiplica()
{
return N1 * N2;
}


public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
N1 = int.Parse(D1.Text);
N2 = int.Parse(D2.Text);
int R1 = suma();
int R2 = multiplica();
listBox1.Items.Add("Suma:" + R1);
listBox1.Items.Add("Multiplicacion:" + R2);

}

private void button2_Click(object sender, EventArgs e)
{
D1.Clear();
D2.Clear();
listBox1.Items.Clear();
}

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

Practica 12.1 Consola


PSEUDOCODIGO

static void ImpriMemensaje (string Dato)

{
PRINT (Dato);
}
static void Main ()
{
string mensaje;
PRINT "Introduce mensaje para navidad"
READ mensaje
ImpriMemensaje (mensaje);
ImpriMemensaje (mensaje);
ImpriMemensaje(mensaje);
FINAL





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

namespace METODO_C
{
class Program
{
static void ImpriMemensaje (string Dato)

{
Console.WriteLine(Dato);
}
static void Main ()
{
string mensaje;
Console.WriteLine("Introduce mensaje para navidad");
mensaje = Console.ReadLine();
ImpriMemensaje (mensaje);
ImpriMemensaje (mensaje);
ImpriMemensaje(mensaje);
Console.ReadKey();


}
}
}

Practica 11.4 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 < suma="0;" c =" 0;" suma =" suma" c =" 0;" suma =" 0;" r =" 0;" suma =" suma" r =" 0;"> 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 <> mayor)
{
mayor = produccion[12, c];
diap = c + 1;
}
}
Print "Dia con mayor produccion:"
switch(diap)
{
case 1: print "Lunes"
break;
case 2: print "Martes"
break;
case 3: print "Miercoles"
break;
case 4: print "Jueves"

break;
case 5: print "Viernes"
break;
case 6: print "Sabado"
break;
case 7: print "Domingo"
break;
}
Prin t"Mayor Produccion en un dia", mayor
FIN

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

namespace PRACTICA_11_4_C
{
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 < suma="0;" c =" 0;" suma =" suma" c =" 0;" suma =" 0;" r =" 0;" suma =" suma" r =" 0;"> 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 <> mayor)
{
mayor = produccion[12, c];
diap = c + 1;
}
}
Console.WriteLine("Dia con mayor produccion:");
switch(diap)
{
case 1: Console.WriteLine("Lunes");
break;
case 2: Console.WriteLine("Martes");
break;
case 3: Console.WriteLine("Miercoles");
break;
case 4: Console.WriteLine("Jueves");

break;
case 5: Console.WriteLine("Viernes");
break;
case 6: Console.WriteLine("Sabado");
break;
case 7: Console.WriteLine("Domingo");
break;
}
Console.WriteLine("Mayor Produccion en un dia {0}", mayor);
Console.ReadKey();





}
}
}

Practica 11.3 Visual


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Accidentes_W
{
public partial class Form1 : Form
{
ArregloBidimencional Reticula = new ArregloBidimencional(10, 29);
int avenida, calle, numacc, I = 0, J = 0;
int mayor1, indice1R = 0, indice1C = 0;
int mayor2, indice2R = 0, indice2C = 0;
int mayor3, indice3R = 0, indice3C = 0;
String salida = "";
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

avenida = int.Parse(textBox1.Text);
textBox1.Clear();
calle = int.Parse(textBox2.Text);
textBox2.Clear();
numacc = int.Parse(textBox3.Text);
textBox3.Clear();
Reticula.numeroaccidentes(avenida - 1, calle - 30, numacc);
}

private void button2_Click(object sender, EventArgs e)
{
for (I = 0; I < salida = "" j =" 0;" mayor1 =" Reticula.DatoMayor(10," indice1r =" Reticula.indRenglon;" indice1c =" Reticula.indColumna;" mayor2 =" Reticula.DatoMayor(10," indice2r =" Reticula.indRenglon;" indice2c =" Reticula.indColumna;" mayor3 =" Reticula.DatoMayor(10," indice3r =" Reticula.indRenglon;" indice3c =" Reticula.indColumna;">

Practica 11.3 Consola




PSEUDOCODIGO


int ciudad [10, 29]
int ave, calle, AC, a, c, suige, posave=0, poscalle=0;
int mayor = 0;
do
{
do
{
PRINT "Introduce No. de Avenida"
READ ave
if(ave<1>10)
{
PRINT "ERRORO AL INTRODUCIR AVENIDA"
}
}

while(ave<1>10);
do
{
PRINT "Introduce No de Calle"
READ calle
if(calle<30>58)
{
PRINT "ERRORO AL INTRODUCIR LA CALLE"
}
}

while(calle<30>58);
PRINT "Introduce Numero de Accidentes"
READ AC
ciudad[ave-1,calle-30]=AC;
PRINT "Precione 1 Para Continuar O Cero Para Entrada de Datos"
READ suige
}
while(suige==1);
for (a = 0; a <= 9; a++) { for (c = 0; c <= 28; c++) { if (ciudad[a, c] > mayor)
{
mayor = ciudad[a, c];
posave = a;
poscalle = c;
}
}
}

PRINT "la primera interseccion mas peligrosas estaentre la avenida:
PRINT “la calle:”
PRINT “con numero de accindetes”
ciudad[posave,poscalle]=0;
mayor=0;

fin


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, AC, a, c, suige, posave=0, poscalle=0;
int mayor = 0;
do
{
do
{
Console.WriteLine("Introduce No. de Avenida");
ave=int.Parse(Console.ReadLine());
if(ave<1>10)
{
Console.WriteLine("ERRORO AL INTRODUCIR AVENIDA");
}
}

while(ave<1>10);
do
{
Console.WriteLine("Introduce No de Calle");
calle=int.Parse(Console.ReadLine());
if(calle<30>58)
{
Console.WriteLine("ERRORO AL INTRODUCIR LA CALLE");
}
}

while(calle<30>58);
Console.WriteLine("Introduce Numero de Accidentes");
AC=int.Parse(Console.ReadLine());
ciudad[ave-1,calle-30]=AC;
Console.WriteLine("Precione 1 Para Continuar O Cero Para Entrada de Datos");
suige=int.Parse(Console.ReadLine());
}
while(suige==1);
for (a = 0; a <= 9; a++) { for (c = 0; c <= 28; c++) { if (ciudad[a, c] > mayor)
{
mayor = ciudad[a, c];
posave = a;
poscalle = c;
}
}
}
Console.WriteLine("la primera interseccion mas peligrosas estaentre la avenida: {0}\ty la la calle {1} \tcon numero de accindetes {2}",posave,poscalle,mayor);
ciudad[posave,poscalle]=0;
mayor=0;
Console.ReadKey();
}
}
}

miércoles, 9 de diciembre de 2009

Practica 11.3 Consola

PSEUDOCODIGO


int ciudad [10, 29]
int ave, calle, AC, a, c, suige, posave=0, poscalle=0;
int mayor = 0;
do
{
do
{
PRINT "Introduce No. de Avenida"
READ ave
if(ave<1>10)
{
PRINT "ERRORO AL INTRODUCIR AVENIDA"
}
}

while(ave<1>10);
do
{
PRINT "Introduce No de Calle"
READ calle
if(calle<30>58)
{
PRINT "ERRORO AL INTRODUCIR LA CALLE"
}
}

while(calle<30>58);
PRINT "Introduce Numero de Accidentes"
READ AC
ciudad[ave-1,calle-30]=AC;
PRINT "Precione 1 Para Continuar O Cero Para Entrada de Datos"
READ suige
}
while(suige==1);
for (a = 0; a <= 9; a++)
{
for (c = 0; c <= 28; c++)
{
if (ciudad[a, c] > mayor)
{
mayor = ciudad[a, c];
posave = a;
poscalle = c;
}
}
}

PRINT "la primera interseccion mas peligrosas estaentre la avenida:
PRINT “la calle:”
PRINT “con numero de accindetes”
ciudad[posave,poscalle]=0;
mayor=0;

fin




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, AC, a, c, suige, posave=0, poscalle=0;
int mayor = 0;
do
{
do
{
Console.WriteLine("Introduce No. de Avenida");
ave=int.Parse(Console.ReadLine());
if(ave<1>10)
{
Console.WriteLine("ERRORO AL INTRODUCIR AVENIDA");
}
}

while(ave<1>10);
do
{
Console.WriteLine("Introduce No de Calle");
calle=int.Parse(Console.ReadLine());
if(calle<30>58)
{
Console.WriteLine("ERRORO AL INTRODUCIR LA CALLE");
}
}

while(calle<30>58);
Console.WriteLine("Introduce Numero de Accidentes");
AC=int.Parse(Console.ReadLine());
ciudad[ave-1,calle-30]=AC;
Console.WriteLine("Precione 1 Para Continuar O Cero Para Entrada de Datos");
suige=int.Parse(Console.ReadLine());
}
while(suige==1);
for (a = 0; a <= 9; a++)
{
for (c = 0; c <= 28; c++)
{
if[p11.3.jpg] (ciudad[a, c] > mayor)
{
mayor = ciudad[a, c];
posave = a;
poscalle = c;
}
}
}
Console.WriteLine("la primera interseccion mas peligrosas estaentre la avenida: {0}\ty la la calle {1} \tcon numero de accindetes {2}",posave,poscalle,mayor);
ciudad[posave,poscalle]=0;
mayor=0;
Console.ReadKey();
}
}
}

Practica 11.2 Visual

[11.2.jpg]
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 Vendedores_W
{
public partial class Form1 : Form
{
double[,] sueldos = new double[10, 20];
double[] Precio = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
int NV, ART, N;

public Form1()
{
InitializeComponent();
listBox1.Items.Add("Vendedor Articulo Cantidad");
listBox2.Items.Add("Vendedor Sueldo");

NV = ART = N = 0;
}

private void button1_Click(object sender, EventArgs e)
{




NV = int.Parse(VTXT.Text);
VTXT.Clear();
ART = int.Parse(A.Text);
A.Clear();
N = int.Parse(C.Text);
C.Clear();

listBox1.Items.Add(NV.ToString() + "\t\t" + ART.ToString() + "\t" + N.ToString());
sueldos[NV - 1, ART - 1] = sueldos[NV - 1, ART - 1] + N * Precio[ART - 1];







}

private void button2_Click(object sender, EventArgs e)
{
int V, P;
double SUM, salario;
for (V=0;V<10;v=v+1) sum =" 0;" p="0;P<20;P="P+1)" sum =" SUM" salario =" SUM">

Practica 11.2 Consola

[p11.2.jpg]
PSEUDOCODIGO

doublE sueldos[10, 20]
double[] precio = { 2.50, 3.90, 5.78, 23.45, 34.56, 13.24, 12.30, 23.43, 34.56, 34.67, 34.67, 34.23, 45.56, 32.34, 34.34, 34.45, 67.56, 45.67, 45.34, 45.45 };
int Nv, Art, N, sigue = 1;

do
{
print "Numero de vendedor:"

read Nv

print "Numero de articulo:"

read Art

print "Cantidad de articulo:"

read N

sueldos[Nv - 1, Art - 1] = sueldos[Nv - 1, Art - 1] + N * precio[Art - 1];

print "Presione 1 para continuar o 0 para calcular sueldos"
read sigue
}
while (sigue == 1);
{
int v, p;
double sum, salario;
for (v = 0; v < v =" v" sum =" 0;" p =" 0;" p =" p" sum =" sum" salario =" sum">


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

namespace PRACTICA_11_VENDEDORES_C
{
class Program
{
static void Main(string[] args)
{
double[,] sueldos = new double[10, 20];
double[] precio = { 2.50, 3.90, 5.78, 23.45, 34.56, 13.24, 12.30, 23.43, 34.56, 34.67, 34.67, 34.23, 45.56, 32.34, 34.34, 34.45, 67.56, 45.67, 45.34, 45.45 };
int Nv, Art, N, sigue = 1;

do
{
Console.WriteLine("Numero de vendedor:");

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

Console.WriteLine("Numero 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("Presione 1 para continuar o 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;" p =" 0;" p =" p" sum =" sum" salario =" sum">

Practica 11.1 Visual

[11_1.jpg]

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 Valor_Maximo_W
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
int[,] num = { { 16, 22, 99, 4, 18 }, { -258, 4, 101, 5, 98 }, { 105, 6, 15, 2, 45 }, { 33, 88, 72, 16, 3 } };
int Mayor = num[0, 0];
int posR = 0, posC = 0, R, C;

for (R = 0; R < 4; R++)
{
for (C = 0; C < 5; C++)
{
if (num[R, C] > Mayor)
{
posR = R;
posC = C;
Mayor = num[R, C];
}
}
}
for (R = 0; R < 4; R++)
{
for (C = 0; C < 5; C++)
{
listBox1.Items.Add(num[R, C]);

}

}
MessageBox.Show("\nEl dato mayor es: " + Mayor +"\n"+ "En el renglon: " + posR + 1 +"\n"+ "Y la columna: " + posC + 1);
}

private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}

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

Practica 11.1 Consola

PSEUDOCODIGO

int[,] num = {{ 16, 22, 99, 4, 18 },{ -258, 4, 101, 5, 98 },{ 105, 6, 15, 2, 45 },{ 33, 88, 72, 16, 3 }};
int Mayor = num[0, 0];
int posR = 0, posC = 0, R, C;
for (R = 0; R <4; R++)
{
for (C = 0; C <5 ; C++)
{
if (num[R, C] > Mayor)
{
posR = R;
posC = C;
Mayor = num[R, C];
}
}
}
for (R = 0; R < 4; R++)
{
for (C = 0; C < 5; C++)
{
print num[R, C]);
}
print Mayor
print posR+1
print posC+1

FIN




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

namespace PRACTICA_11_1C
{
class Program
{
static void Main(string[] args)
{
int[,] num = {{ 16, 22, 99, 4, 18 },{ -258, 4, 101, 5, 98 },{ 105, 6, 15, 2, 45 },{ 33, 88, 72, 16, 3 }};
int Mayor = num[0, 0];
int posR = 0, posC = 0, R, C;
for (R = 0; R <4; R++)
{
for (C = 0; C <5 ; C++)
{
if (num[R, C] > Mayor)
{
posR = R;
posC = C;
Mayor = num[R, C];
}
}
}
for (R = 0; R < 4; R++)
{
for (C = 0; C < 5; C++)
{
Console.Write("\t{0}", num[R, C]);
}
Console.WriteLine();
}
Console.WriteLine("El dato mayor es: {0}", Mayor);
Console.WriteLine("En el renglon: {0}", posR+1);
Console.WriteLine("Y la columna: {0}", posC+1);

Console.ReadKey();


}
}
}
[p11.1.jpg]