programacion

Páginas: 19 (4527 palabras) Publicado: 4 de noviembre de 2013
INSTITUTO TECNOLÒGICO DE TIJUANA

FUNDAMENTOS DE PROGRAMACIÒN
CODIGOS DE PROGRAMAS Y PANTALLAS

MANUEL DE JESUS GONZALEZ MERAZ

PROF: MARCO RODRIGUEZ







Contenido




SUMA, RESTA, MULTIPLICACION Y DIVISION
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 cmd_suma_Click(object sender, EventArgs e)
{

double n1, n2, res; // declarando las variables

n1 = Convert.ToDouble(txtnumero1);//convierte lo de mi caja de texto en decimal
n2 = Convert.ToDouble(txtnumero2);// convierte lo de mi caja de texto en decimal
res = n1 + n2;// la operacion que se va a realizar
txtresultado.Text = res.ToString();// en mi caja de texto resultado, saldra lo de la operacion res
txtresultado.Visible = true;// cuando salga el resulltado la caja de textose actiavara

}

private void cmd_resta_Click(object sender, EventArgs e)
{

double n1, n2, res; // declarando las variables

n1 = Convert.ToDouble(txtnumero1);// convierte lo de mi caja de texto en decimal
n2 = Convert.ToDouble(txtnumero2);// convierte lo de mi caja de texto en decimal
res =n1 - n2;// la operacion que se va a realizar
txtresultado.Text = res.ToString();// en mi caja de texto resultado, saldra lo de la operacion res
txtresultado.Visible = true;// cuando salga el resulltado la caja de texto se actiavara

}

private void cmd_multi_Click(object sender, EventArgs e)
{


doublen1, n2, res; // declarando las variables

n1 = Convert.ToDouble(txtnumero1);// convierte lo de mi caja de texto en decimal
n2 = Convert.ToDouble(txtnumero2);// convierte lo de mi caja de texto en decimal
res = n1 * n2;// la operacion que se va a realizar
txtresultado.Text = res.ToString();// en mi caja de texto resultado, saldra lo de la operacionres
txtresultado.Visible = true;// cuando salga el resulltado la caja de texto se actiavara

}

private void cmd_division_Click(object sender, EventArgs e)
{


double n1, n2, res; // declarando las variables

n1 = Convert.ToDouble(txtnumero1);// convierte lo de mi caja de texto en decimal
n2= Convert.ToDouble(txtnumero2);// convierte lo de mi caja de texto en decimal
res =( n1 / n2) ;// la operacion que se va a realizar
txtresultado.Text = res.ToString();// en mi caja de texto resultado, saldra lo de la operacion res
txtresultado.Visible = true;// cuando salga el resulltado la caja de texto se actiavara


SUMA, RESTA, MULTIPLICACION YDIVISION CON VENTANAS
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;
// INSTITUTO TECNOLÒGICO DE TIJUANA
// INGENIERA EN SISTEMAS COMPPUTACIONALES
// MANUEL DE JESUS GONZALEZ MERAZ
namespace WindowsFormsApplication1
{
public partial class FRMSUMA :Form
{
public FRMSUMA()
{
InitializeComponent();
}

private void FRMSUMA_Load(object sender, EventArgs e)
{

}

private void cmdcalcularsuma_Click(object sender, EventArgs e)
{
double n1, n2, res;// DECLARO MIS VARIABLEES
n1 = Convert.ToDouble(txtnumero1.Text);
n2 =...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Programación
  • Programacion
  • Programacion
  • Programación
  • Programacion
  • Programacion
  • Programacion
  • Programacion

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS