martes, 20 de octubre de 2009

PRACTICA 7.1

SEUDOCODIGO

InicioReal sumaserie = 1.0, termino
Int d
Print “+”,1
For d=2 to 198 step d=d+2
{termino+1.0/dprint termino “+”
sumaserie = sumaserie + termino}
print “=” , sumaserie final




CONSOLA










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_WINDOWS
{
public partial class Form1 : Form
{
double SUMASERIE, TERMINO, VALOR;
int D;
public Form1()
{
TERMINO = D;
SUMASERIE = 1.0;
VALOR = 1;
InitializeComponent();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("+" + VALOR.ToString());
for (D = 2; D <= 198; D = D + 2)
{
TERMINO = 1.0 / D;
listBox1.Items.Add("+" + TERMINO.ToString());
SUMASERIE = SUMASERIE + TERMINO;
}
listBox1.Items.Add("=" + SUMASERIE.ToString());
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}

PRACTICA 7.2

SEUDOCODIGO


inicio

Real n, i, suma = 0;
Print “numero par entero”
Read n
if (n <>

for i = 2 to n; estep 2.0 { suma = suma + i; }

Print “suma de los pares es”, suma); Fin


CONSOLA



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._2_WINDOWS
{
public partial class Form1 : Form
{
double n, i, suma;
public Form1()
{
n = i;
suma = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
n = double.Parse(textBox1.Text);
if (n < text =" (" i =" 2;" i =" i" suma =" suma" text =" (">





PRACTICA 7.3

SEUDOCODIGO



Real n, k, exp;
k = 1;
print “ un numero”Read n
print “televado a la potencia resultado"
while (k <= n) { exp = Math.Pow(k, k);

print “k,k,exp” k = k + 1; }fin



CONSOLA




visual


PRACTICA 7.5

SEUDOCODIGO


Inicio
int rep, num,total, c = 1
int sumpar = 0
int sumimpar = 0
Print "Intreoduce cantidad de numeros"
Read rep
while (c <= rep)

{

Print "Introduce un numero entero"

Read num if (num % 2 == 0)

{

sumpar = sumpar + num

}

if (num % 2 == 1)

{

sumimpar = sumimpar + num

}

c = c + 1 } Print (sumpar) Print (sumimpar) total = 0 if (sumpar > sumimpar)
{
total = sumpar
}
else
{
Print (sumimpar)
}

if (sumpar <>

{

total = sumimpar

}

else

{

Print (sumpar)

}

Fin


CONSOLA







visual

PRACTICA 7.4

CONSOLA



visual





PRACTICA 7.6

SEUDOCODIGO

Inicio


int n,valor, mayor, menor, c = 1;
Print Introduce cantidad de numeros"
Read n
Print "Introduceun valor entero"
Read Valor
mayor = valor;
menor = valor;
c = 1;
while (cmayor)
{
mayor = valor;
}
if(valor==menor)
{ menor = valor;
}

c=c+1;}
Pint "el dato mayor es “,mayor

Pirnt "el dato menor es “,menor);

Final


CONSOLA

visual

PRACTICA 7.7

SEUDOCODIGO
Inicio
double valoresN = 0.0, Suma, dmayor, contador, valor2;

Print “Introduce la cantidad de valores a procesar "
Read valoresN
Suma = 0.0; dmayor = 0.0;
for contador = 1 tovaloresN step contador = contador + 1)
{
Print “Introduce valor"Read Rvalor2
Suma = Suma + valor2;
if (valor2 > dmayor)
{
dmayor = valor2;
}
Print “suma de los valores es: ", Suma
Print “El promedio es : ", Suma , valoresNFinal


CONSOLA

PRACTICA 7.8

SEUDOCODIGO

Inicio int n, p = 1, c;
Print "introduce cantidad de numeros"
Read N
for c = 1 to n step c = c + 2)
{
p = p * c;
}
Print el producto es", p
final



CONSOLA


WINDOWS


lunes, 19 de octubre de 2009

SUMA DE IMPARES

FLUJO


CONSOLA


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PRACTICA_6._2_CONSOLE
{
class Program
{
static void Main(string[] args)
{
double n, i, suma = 0;
Console.WriteLine("\n\nINTRODUCE UN NUMERO");
n = double.Parse(Console.ReadLine());
for (i = 1; i <= n; i = i + 2) { suma = suma + i; } Console.WriteLine("\n\nLA SUMA DE LOS IMPARES ES: {0} ", suma); Console.ReadLine(); } } }


WINDOWS


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace PRACTICA_6._2_WINDOWS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double n, i, suma = 0;
n = double.Parse(textBox1.Text);
for (i = 1; i <= n; i = i + 2) { suma = suma + i; } textBox2.Text = suma.ToString(); } private void button2_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); } private void button3_Click(object sender, EventArgs e) { Close(); } private void textBox2_TextChanged(object sender, EventArgs e) { } } }

viernes, 16 de octubre de 2009

PRACTICA 6.3

CONSOLA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_6._3_console
{
class Program
{
static void Main(string[] args)
{
double t, pob;
double A = 1994;
Console.WriteLine("\nAo\t\t\tpoblacion");
for (t = 9; t <= 25; t = t + 1) { pob = 4.88 * (1 + Math.Exp(0.02 * t)); Console.WriteLine("\n{0} \t\t\t{1}", A, pob); A++; } Console.ReadLine(); } } }

WINDOWS



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_6._3_windows
{
public partial class Form1 : Form
{
double t, pob;
double A=1994;
public Form1()
{
double A = 1994;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("\nAo\t\tpoblacion");
for (t = 9; t <= 25; t = t + 1) { pob = 4.88 * (1 + Math.Exp(0.02 * t)); listBox1.Items.Add(A.ToString()+ "\t\t" + pob.ToString()); A++; } } private void button2_Click(object sender, EventArgs e) { listBox1.Items.Clear(); } private void button3_Click(object sender, EventArgs e) { Close(); } } }

PRACTICA 6.2C

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


WINDOWS
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_6._2C_windows
{
public partial class Form1 : Form
{
double t, y;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("VALOR DE T \tVALOR DE Y");
for (t = 5; t <= 10; t = t + 0.5) { y = 2 * Math.Exp(0.8 * t); listBox1.Items.Add(t.ToString() + "\t\t" + y.ToString()); } } private void button3_Click(object sender, EventArgs e) { listBox1.Items.Clear(); } private void button2_Click(object sender, EventArgs e) { Close(); } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { } } }

PRACTICA 6.2B

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


WINDOWS
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace PRACTICA_6._2B_WINDOWS
{
public partial class Form1 : Form
{
double x, y;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double x, y;
listBox1.Items.Add("VALOR DE X \tVALOR DE Y");
for (x = 1; x <= 5; x = x + 0.1) { y = 1 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4) / 24.0; listBox1.Items.Add(x.ToString() + "\t\t" + y.ToString()); } } private void button3_Click(object sender, EventArgs e) { listBox1.Items.Clear(); } private void button2_Click(object sender, EventArgs e) { Close(); } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { } }

PRACTICA 6.2A

FLUJO

CONSOLA

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




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_6._2A_windows
{
public partial class Form1 : Form
{
double x, y;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double x, y;
listBox1.Items.Add("VALOR DE X \t\tVALOR DE Y");
for (x = 2; x <= 10; x = x + 0.2) { y = 3 * Math.Pow(x, 5) + 2 * Math.Pow(x, 3) + x; listBox1.Items.Add(x.ToString()+ "\t\t" + y.ToString()); } } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { } } }

jueves, 15 de octubre de 2009

PRACTICA 6.1

FLUJO

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

namespace practica_6._1_windows
{
public partial class Form1 : Form
{
double factor, n, i;

public Form1()
{
factor = 1.0;

InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
double n, i, factor = 1.0;
n = int.Parse(textBox1.Text);
for (i =n; i >= 1; i--)
for (i = n; i >= 1; i--)
{
factor = factor * i;
}
textBox2.Text = factor.ToString();
}

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

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

private void Form1_Load(object sender, EventArgs e)
{

}
}
}

PRACTICA 5.4

speudicodigo

double x, y;

print"funcion matematica");

print"nvalor de x valor de y";

for (x = 1 to x <= 5 step x = x + 0.1)

{

y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4)/24.0;

print("{0} {1} ", x, y);

}

fin



CONSOLA

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace practica_6._4_console

{ class Program

{

static void Main(string[] args)

{

double x, y;

Console.WriteLine("\t\tfuncion matematica");

Console.WriteLine("\nvalor de x t\t\tvalor de y");

for (x = 1; x <= 5; x = x + 0.1)

{

y = 1.0 + x + Math.Pow(x, 2) / 2.0 + Math.Pow(x, 3) / 6.0 + Math.Pow(x, 4)/24.0;

Console.WriteLine("{0} \t\t\t{1} ", x, y);

}

Console.ReadLine();

}

}

}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_5._4_console
{
class Program
{
static void Main(string[] args)
{
double t, rad, x, y;
t = 0;
rad = Math.PI * 22.8 / 180;
Console.WriteLine("\ntiempo \tvalor de x \t\tvalor de y");
while(t<10) x =" 500" y =" 500" t =" t">

WINDOWS
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_5._4_windows
{
public partial class Form1 : Form
{
double T, RAD, X, Y;
public Form1()
{
T = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double T, RAD, X, Y;
T = 0;
RAD = Math.PI * 22.8 / 180;
listBox1.Items.Add("TIEMPO \tVALOR DE X \t\tVALOR DE Y");
do
{
X = 500 * T * Math.Cos(RAD);
Y = 500 * T * Math.Sin(RAD);
listBox1.Items.Add(T.ToString() + "\t" + X.ToString() + "\t\t" + Y.ToString());
T=T+ 1.0/2.0;
}
while(T<=10);
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}

PRACTICA 5.3

CONSOLA


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

namespace practica_5._3_console
{
class Program
{
static void Main(string[] args)
{
int num, anum, dig;

Console.WriteLine("\n\nintroduce un valor entero");
num = int.Parse(Console.ReadLine());
anum = num;
do
{
dig = anum % 10;
Console.WriteLine("\ndigito {0}", dig);
anum = anum / 10;
}
while (anum != 0);
Console.ReadLine();
}
}
}

WINDOWS

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

namespace practica_5._3_windows
{
public partial class Form1 : Form
{
int num, anum, dig;

public Form1()
{
num= anum= dig=0;

InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
int num, anum, dig;

num = int.Parse(textBox1.Text);
anum = num;
do
{
dig = anum % 10;
listBox1.Items.Add("digito\t " + dig.ToString());
anum = anum / 10;
}
while (anum != 0);
}

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

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

private void Form1_Load(object sender, EventArgs e)
{

}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}
}
}

PRACTICA 5.2 D

CONSOLA


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_5._2D_console
{
class Program
{
static void Main(string[] args)
{
int c1, er;
c1 = 0;
er = 0;
do
{
Console.WriteLine(" \n Introduce Calificacion");
c1 = int.Parse(Console.ReadLine());
if (c1 <> 100)
{
er = er + 1;
}
}
while (er <>



WINDOWS



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_5._2D_windows
{
public partial class Form1 : Form
{
int c1, er;
public Form1()
{
c1 = 0;
er = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 <> 100)
{
listBox1.Items.Add(c1.ToString());
er = er + 1;
}
else
{
listBox1.Items.Add(c1);
}
if (er > 5)
{ Close(); }
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}

lunes, 12 de octubre de 2009

PRACTICA 5.2 C

CONSOLA


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_5._2C_console
{
class Program
{
static void Main(string[] args)
{
int C1;
C1 = 0;
do
{
Console.WriteLine("\nINTRODUZCA LA CALIFICACION");
C1 = int.Parse(Console.ReadLine());
Console.WriteLine("\nCalificacion=\t{0}", C1);
}
while (C1 != 999);
Console.ReadLine();
}
}
}
WINDOWS










using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_5._2C_windows
{
public partial class Form1 : Form
{
int c1, codigo = 999;
public Form1()
{
c1 = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 == codigo)
Close();
if (c1 <> 100)
{
textBox1.Enabled = false;
listBox1.Items.Add("Calificacion Incorrecta");
}
else
{
listBox1.Items.Add(c1);
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}

PRACTICA 5.1 B

CONSOLA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_5._2B_console
{
class Program
{
static void Main(string[] args)
{
int C1;
C1 = 0;
do
{
Console.WriteLine("\nINTRODUZCA LA CALIFICACION");
C1 = int.Parse(Console.ReadLine());
Console.WriteLine("\nCalificacion=\t{0}", C1);
}
while (C1>= 0 && C1 <=100); { Console.WriteLine("\nCALIFICACION INVALIDA"); } Console.ReadLine(); } } }








WINDOWS


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace practica_5._2B_windows
{
public partial class Form1 : Form
{
int c1;
public Form1()
{
c1 = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 <> 100)
{
textBox1.Enabled = false;
listBox1.Items.Add("Calificacion Incorrecta");
}
else
{
listBox1.Items.Add(c1);
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}