ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Hojas de ciclos


Enviado por   •  7 de Octubre de 2019  •  Apuntes  •  6.825 Palabras (28 Páginas)  •  127 Visitas

Página 1 de 28

Àrea Rectàngulo

[pic 1]

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace ejemplo1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        private void btnCalcular_Click(object sender, EventArgs e)

        {

            //declaracion de variables

            int b, h, a, p;

            //entrada de datos

            b = Convert.ToInt32(txtBase.Text); //asignado a la variable B;CONVERT CONVIERTE A ENTERO

            h = Convert.ToInt32(txtAltura.Text);

            //Proceso

            a = b * h;

            p = (b + h) * 2;

            //Salida de resultados

            txtÀrea.Text = Convert.ToString(a);// a entero y txtarea es unstring por eso se convierte

            txtPerimetro.Text = Convert.ToString(p);

        }

        private void btnSalir_Click(object sender, EventArgs e)

        { //para metodos o propiedades del formulario

            this.Close();                                                                                                                                                                                                                                      

        }

    }

}

Numero de tres cifras

[pic 2]

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace NùmeroEntero

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        private void btnCalcula_Click(object sender, EventArgs e)

        {   //declaracion de variables

            int n, u, d, c, s;

            //entrada de datos

            n = Convert.ToInt32(txtNùmero.Text);

            //Proceso

            c = n / 100;

            d = (n % 100)/10;

            u = (n % 100) % 10;

            s = u + d + c;

            //Salida de resultados

            txtU.Text = Convert.ToString(u);

            txtD.Text = Convert.ToString(d);

            txtC.Text = Convert.ToString(c);

            txtS.Text = Convert.ToString(s);

        }

    }

}

Ejercicios

  1. Promedio

[pic 3]

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        private void btnPromedio_Click(object sender, EventArgs e)

        {

            //declaracion de variables

            double n1, n2, n3, p, c;

            //entrada de datos

            n1 = Convert.ToDouble(txtN1.Text);

            n2 = Convert.ToDouble(txtN2.Text);

            n3 = Convert.ToDouble(txtN3.Text);

            //Proceso

            p = (n1*0.2 + n2*0.5 + n3*0.3) / 3;

...

Descargar como (para miembros actualizados)  txt (20.8 Kb)   pdf (378.5 Kb)   docx (386.2 Kb)  
Leer 27 páginas más »
Disponible sólo en Clubensayos.com