Inteligencia artificial
















  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

ESTADO DEL ARTE DE LAS METODOLOGIAS DE DESARROLLO

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

trapecio

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


namespace Trapecio
{
// Nombre : aptrapecio
// Proposito : trapecio.
// Autor : gabriela
// FModificación : --

class apTrapecio
{
static void Main(string[] args)
{
// Variables
int BMay ;
int BMen;
int Altura;
int Area;
// Indicar que hace el programa
Console.WriteLine ("ESTE PROGRAMA CALCULA EL AREA DEL TRAPECIO\n");

// Leer datos de entrada
Console.Write ("Ingrese la base mayor: ");
BMay=int.Parse (Console.ReadLine());

Console.Write ("Ingrese la base menor: ");
BMen=int.Parse (Console.ReadLine());

Console.Write("Ingrese la altura: ");
Altura = int.Parse(Console.ReadLine());



// Procesar - Calcular el area del trapecio
// ingresados
Area = ((BMay + BMen) / 2 )* Altura;

// Mostrar resultados
Console.Write ("\nEl area del trapecio es: {0}\n",Area);
Console.ReadLine();

}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

calcula el perimetro y el area de un rectangulo

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

namespace ConsoleApplication1
{
class ApRectangulo
{
static void Main(string[] args)
{
//variables
int lado1;
int lado2;
int perimetro;
int area;
//Indicar que hace el programa


Console.WriteLine("Este programa calcula el perimetro y el area de un rectangulo");

//Leer datos
Console.Write("Ingrese el lado1 del rectangulo: ");
lado1 = int.Parse(Console.ReadLine());

Console.Write("Ingrese el lado2 del rectangulo: ");
lado2 = int.Parse(Console.ReadLine());

//Procesar – calcular el perimetro del rectangulo
perimetro = (2 * lado1) + (2 * lado2);
area = lado1 * lado2;

//Mostrar Resultados
Console.WriteLine("El perimetro del rectangulo es {0}",
perimetro );
Console.WriteLine("El area del rectangulo es {0}",
area );
Console.ReadLine();
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Calcula el promedio de tres numeros

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

namespace promedioTresNumeros
{
// Nombre : apPromedioTresNumeros
// Proposito : Calcula el promedio de tres numeros.
// Autor : gabriela
// FModificación : --

class apPromedioTresNumeros
{
static void Main(string[] args)
{
// Variables
int numero1;
int numero2;
int numero3;
int promedio;

// Indicar que hace el programa

Console.WriteLine ("ESTE PROGRAMA CALCULA EL PROMEDIO DE TRES NUMEROS\n");

// Leer datos de entrada
Console.Write ("Ingrese el primer numero: ");
numero1=int.Parse (Console.ReadLine());

Console.Write ("Ingrese el segundo numero: ");
numero2=int.Parse (Console.ReadLine());

Console.Write ("Ingrese el tercer numero: ");
numero3=int.Parse (Console.ReadLine());

// Procesar - Calcular el promedio de los tres números
// ingresados
promedio = (numero1+numero2+numero3)/3;

// Mostrar resultados
Console.Write ("\nEl promedio de los tres numeros ingresados es: {0}\n",promedio);
Console.ReadLine();
}
}


}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Calcula el perimetro de un cuadrado

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

namespace lecturaDeDatos
{
//Nombre : ApPerimetro
//Proposito : Calcula el perimetro de un cuadrado
//Autor : gabriela
//FModificacion : --

class ApPerimetro
{
static void Main(string[] args)
{
//Variables
int Lado;
int Perimetro;


//Indicar que hace el programa


Console.WriteLine("Este programa calcula el perimetro de un cuadrado");

//Leer datos
Console.Write("Ingrese el lado del cuadrado: ");
Lado = int.Parse(Console.ReadLine());

//Procesar – calcular el perimetro del cuadrado
Perimetro = 4 * Lado;


//Mostrar Resultados
Console.WriteLine("El perimetro del cuadrado es {0}",
Perimetro);
Console.ReadLine();
}
}

}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Registra los datos de una persona

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


namespace registroDeDatos
{
//Nombre : apRegistroDeDatos
//Proposito : Registra los datos de una persona
//Autor : gabriela
//FModificacion : --

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

//Variables
string Nombre;
string ApPaterno;
string ApMaterno;
int Edad;

//Indicar que hace el programa
Console.WriteLine("PROGRAMA DE REGISTRO DE DATOS \n");

//Leer datos
Console.Write("Ingrese su nombre: ");
Nombre = Console.ReadLine();
Console.Write("Ingrese su apellido paterno: ");
ApPaterno = Console.ReadLine();
Console.Write("Ingrese su apellido materno: ");
ApMaterno = Console.ReadLine();

/* El siguiente par de instrucciones, permite leer un
numero entero por el teclado. Notese que los datos
leidos deben ser explicitamente convertidos */
Console.Write("Ingrese su edad: ");
Edad = int.Parse(Console.ReadLine());

//Mostrar resultados
Console.WriteLine("------------------------------------");
Console.WriteLine(" NOMBRE : {0}",Nombre );
Console.WriteLine(" AP. PATERNO : {0}",ApPaterno );
Console.WriteLine(" AP. MATERNO : {0}",ApMaterno );
Console.WriteLine(" EDAD : {0} años",Edad );
Console.WriteLine("------------------------------------");

Console.ReadLine();

}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

calcula el cubo de un numero entero

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

namespace ApCubo
{
class Program
{
static void Main(string[] args)
{
//variables

int numero;
int cubo;
//Indicar que hace el programa


Console.WriteLine("Este programa calcula el cubo de un numero entero");

//Leer datos
Console.Write("Ingrese un numero entero: ");
numero = int.Parse(Console.ReadLine());


//Procesar – calcular el cubo de un numero entero
cubo = numero * numero * numero;



//Mostrar Resultados
Console.WriteLine("El perimetro del cuadrado es {0}",
cubo );
Console.ReadLine();
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

calcula la velocidad de un objeto

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

namespace FisicaMecanica
{
// Nombre : apCalcularVelocidad
// Proposito : calcula la velocidad de un objeto
// Autor : gabriela
// FModificacion : --

class apCalcularVelocidad
{
static void Main(string[] args)
{
// Variables
float distancia;
float tiempo;
float velocidad;

//Indicar que hace el programa
Console.WriteLine("ESTE PROGRAMA CALCULA lA VELOCIDAD DE UN OBJETO DE ACUERDO");
Console.WriteLine("AL ESPACIO QUE RECORRE Y EL TIEMPO DE RECORRIDO");
Console.WriteLine();

// Leer datos
Console.Write("Ingresa la distancia en metros: ");
distancia = float.Parse(Console.ReadLine());
Console.Write("Ingresa el tiempo en segundos: ");
tiempo = float.Parse(Console.ReadLine());

// Procesar
velocidad = distancia / tiempo;

// Mostrar resultados
Console.WriteLine("La velocidad es del objeto es: {0}m/s", velocidad);

Console.ReadLine();

}
}

}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Calcula el area de un cuadrado

este es un algoritmo para Calcula el area de un cuadrado

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

namespace lecturaDeDatos
{
//Nombre : ApAreaCuadrado
//Proposito : Calcula el area de un cuadrado
//Autor : gabriela
//FModificacion : --

class ApArea
{
static void Main(string[] args)
{
//variables
float lado;
float area;
////Indicar que hace el programa


Console.WriteLine("Este programa calcula el area de un cuadrado");

//Leer datos
Console.Write("Ingrese el lado del cuadrado: ");
lado = float.Parse(Console.ReadLine());

//Procesar – calcular el perimetro del cuadrado
area = lado * lado;


//Mostrar Resultados
Console.WriteLine("El area del cuadrado es {0}", area);
Console.ReadLine();
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

importar imagenes


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

namespace imagenes
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnSeleccionar_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "seleccionar la imagen";
ofd.Title = "todos(*.*)|*.*|imagenes|*.jpg;*.bmp;*.gif;*.bnp";
if (ofd.ShowDialog() == DialogResult.OK)
{
this.pictureBox1.Image= Image.FromFile(ofd.FileName);
}
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

colores


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

namespace colores
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void rdbAzul_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.RoyalBlue;
lbltexto.ForeColor = Color.RoyalBlue;
BackColor = Color.Gray;

}

private void rdbAmarillo_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.Yellow;
lbltexto.ForeColor = Color.Yellow;
BackColor = Color.Indigo;
}

private void rdbVerde_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.Green;
lbltexto.ForeColor = Color.Green;
BackColor = Color.IndianRed;
}

private void rdbNegro_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.Black;
lbltexto.ForeColor = Color.Black;
BackColor = Color.LightGreen;
}

private void rdbRosado_CheckedChanged(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.Pink;
lbltexto.ForeColor = Color.Pink;
BackColor = Color.Gold;
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

promedio final


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

namespace promedio_final
{
public partial class frmpromediofinal : Form
{
public frmpromediofinal()
{
InitializeComponent();
}

private void btnCalProm_Click(object sender, EventArgs e)
{

decimal nota1,nota2,notafinal;

nota1 = (Convert.ToDecimal(this.textBox1.Text) + Convert.ToDecimal(this.textBox2.Text)) / 2;
nota2 = (Convert.ToDecimal(this.textBox3.Text) + Convert.ToDecimal(this.textBox4.Text)) / 2;
notafinal = (nota1 + nota2) / 2;
this.txtPromedio.Text= Convert.ToString(notafinal);

}

private void btnLimpiar_Click(object sender, EventArgs e)
{
txtPromedio.Text = "";
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text="";


}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

mouse


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

namespace mouse
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnmouse_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.lblmouse.Text = "izquierda";
}
else
if (e.Button == MouseButtons.Middle)
{
this.lblmouse.Text = "centro";
}
else
if (e.Button ==MouseButtons.Right)
{
this.lblmouse.Text = "derecha";
}
}

}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

usuario y password


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

namespace Usuario_Pasword
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnAceptar_Click(object sender, EventArgs e)
{
if (txtUsuario.Text == "tuloquita" && txtPasword.Text == "gaby")
{
MessageBox.Show("Usuario y Pasword Valido", "Usuario");

}
else
{
MessageBox.Show("Usuario y Pasword Invalido", "Usuario");
}
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

ingresar un numero de 7 digitos


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

namespace __cifras
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
int unidades, decenas,centenas,unidadesdemillar,decenasdemillar,centenasdemillar,unidaddemillon;
unidades = Convert.ToInt32(this.txtNumero.Text) % 10;
decenas = (Convert.ToInt32(this.txtNumero.Text) %100/10) ;
centenas = (Convert.ToInt32(this.txtNumero.Text) % 1000/100);
unidadesdemillar = (Convert.ToInt32(this.txtNumero.Text) % 10000 / 1000);
decenasdemillar= (Convert.ToInt32(this.txtNumero.Text) % 100000 / 10000);
centenasdemillar = (Convert.ToInt32(this.txtNumero.Text) % 1000000 / 100000);
unidaddemillon = (Convert.ToInt32(this.txtNumero.Text) % 10000000 / 1000000);
this.txtUnidades.Text = Convert.ToString(unidades);
this.txtDecenas.Text = Convert.ToString(decenas);
this.txtCentenas.Text = Convert.ToString(centenas);
this.txtUnidadM.Text = Convert.ToString(unidadesdemillar);
this.txtDecenaM.Text = Convert.ToString(decenasdemillar);
this.txtCentenaM.Text = Convert.ToString(centenasdemillar);
this.txtUnidadMillon.Text = Convert.ToString(unidaddemillon);
this.txtNumero.SelectAll();
this.txtNumero.Focus();
this.txtNumero.Text = "";
}

private void txtNumero_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
this.btnCalcula.Focus();
}
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

caracteristicas de un ordenador


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

namespace ordenador
{
public partial class frmOrdenador : Form
{
public frmOrdenador()
{
InitializeComponent();
}

private void btnMicroprocesador_Click(object sender, EventArgs e)
{
MessageBox.Show("Pentium VI","Microprocesador");

}

private void btnRam_Click(object sender, EventArgs e)
{
MessageBox.Show("1 GB","Memoria RAM");
}

private void button3_Click(object sender, EventArgs e)
{
MessageBox.Show("80 GB","Capacidad del Disco Duro");
}

private void btnSistemaoperativo_Click(object sender, EventArgs e)
{
MessageBox.Show("windows","Sistema Operativo");
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

datos de libro


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

namespace libros
{
public partial class frmLibros : Form
{
public frmLibros()
{
InitializeComponent();
}

private void btnTitulo_Click(object sender, EventArgs e)
{
lbltitulo.Text = "base de datos";
string texto = lbltitulo.Text;
}

private void btnAutor_Click(object sender, EventArgs e)
{
lblAutor.Text = "joyanes";
string texto = lblAutor.Text;
}

private void btnEditorial_Click(object sender, EventArgs e)
{
lblEditorial.Text = "navarrete";
string texto = lblEditorial.Text;
}

private void btnEdicion_Click(object sender, EventArgs e)
{
lblEdicion.Text = "2006";
string texto = lblEdicion.Text;
}

private void btnNrodepaginas_Click(object sender, EventArgs e)
{
lblNrodepaginas.Text = "456";
string texto = lblNrodepaginas.Text;
}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

suma


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

namespace suma
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnsuma_Click(object sender, EventArgs e)
{
int resultado;
resultado = Convert.ToInt32(this.txtnro1.Text) + Convert.ToInt32(this.txtnro2.Text);
this.txtrespuesta.Text = Convert.ToString(resultado);
txtnro1.SelectAll();
txtnro1.Focus();
}

private void txtnro1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
txtnro2.SelectAll();
txtnro2.Focus();
txtnro2.Text = "";
txtrespuesta.Text = "";
}
}

private void txtnro2_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == 13)
this.btnsuma.Focus();
}


}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

mostrar texto


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

namespace ejemplo_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnAceptar_Click(object sender, EventArgs e)
{
MessageBox.Show("bienvenidos a visual c# sharp", "bienvenida");
lblMensaje.Text=("hola a todos ");

}
}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

mensaje de bienvenida


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

namespace ejemplo_1
{
public partial class frmVisualC : Form
{
public frmVisualC()
{
InitializeComponent();
}

private void btnAceptar_Click(object sender, EventArgs e)
{
lblMensaje.Text = "bienvenidos visual c# .net";
}

private void btlLimpiar_Click(object sender, EventArgs e)
{
lblMensaje.Text = "";
}


}
}
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Buscar en este blog