0% found this document useful (0 votes)
17 views

Enunciado 2

The document contains 5 code examples written in C# and Visual Studio that demonstrate algorithms for: 1) Adding two numbers and displaying the sum 2) Determining if an input age is greater than or equal to 18 (adult age) 3) Determining if an input age is greater than or equal to 18 (adult age) or less than 18 4) Determining if an input age and gender combination corresponds to a male minor/adult or female minor/adult 5) Displaying the day of the week corresponding to a numeric day input Each example contains code to input values, perform conditional logic, output results to labels or message boxes, and clear fields for new inputs.

Uploaded by

darlaguerrer675
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Enunciado 2

The document contains 5 code examples written in C# and Visual Studio that demonstrate algorithms for: 1) Adding two numbers and displaying the sum 2) Determining if an input age is greater than or equal to 18 (adult age) 3) Determining if an input age is greater than or equal to 18 (adult age) or less than 18 4) Determining if an input age and gender combination corresponds to a male minor/adult or female minor/adult 5) Displaying the day of the week corresponding to a numeric day input Each example contains code to input values, perform conditional logic, output results to labels or message boxes, and clear fields for new inputs.

Uploaded by

darlaguerrer675
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 31

ENUNCIADO 1

Realizar un algoritmo en visual c# que permita ingresar dos números y su correspondiente suma.
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 Suma_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void label1_Click(object sender, EventArgs e)


{

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void btnCalcular_Click(object sender, EventArgs e)


{
int A, B, S;
A = int.Parse(textBox1.Text);
B = int.Parse(textBox2.Text);
S = A + B;
textBox3.Text = S.ToString();
}

private void btnNuevo_Click(object sender, EventArgs e)


{
textBox1.Text = "";
textBox1.Text = "";
textBox3.Text = "";
textBox1.Focus();
}
private void btnSalir_Click(object sender, EventArgs e)
{
MessageBox.Show("Angel Lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void pictureBox1_Click(object sender, EventArgs e)


{

}
}
}
ENUNCIADO 2
Realizar un algoritmo en visual c# que permita ingresar una edad y luego presentar si es mayor de edad.
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 MayordeEdad_Lao_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
int edad;
edad = int.Parse(txtIngresaredad.Text);
if (edad >= 18)
{
lblResultado.Text="Es mayor de edad";

private void button2_Click(object sender, EventArgs e)


{
txtIngresaredad.Text = "";
txtIngresaredad.Focus();
}

private void button3_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel Lapo 3A Informatica", "Realiado por: ");
this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void txtIngresaredad_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Red;
}

//private void txtResultado_TextChanged(object sender, EventArgs e)


// {
//lblAutor.ForeColor = System.Drawing.Color.YellowGreen;
// }

private void pictureBox1_Click(object sender, EventArgs e)


{

}
}
}
ENUNCIADO 3
Realizar un algoritmo en visual c# que permita ingresar una edad y luego determinar si es mayor o menor
de edad.
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 Edad2_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnAceptar_Click(object sender, EventArgs e)


{
int edad;
edad = int.Parse(textBox1.Text);
if (edad >= 18)
{
lblResultado.Text = "Es mayor de edad";
}
else
{
lblResultado.Text="Es menor de edad";
}

private void btnNuevo_Click(object sender, EventArgs e)


{
textBox1.Text = "";
lblResultado.Text = "Esperando resultado";
textBox1.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void textBox1_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Chocolate;
}

// private void textBox2_TextChanged(object sender, EventArgs e)


// {
// lblAutor.ForeColor = System.Drawing.Color.Chocolate;
//}
}
}
ENUNCIADO 4
Realizar un algoritmo en visual c# que permita ingresar una edad y el genero si es masculino mayor de edad
o menor de edad y femenino mayor o menor de edad.
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 Edad3_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnAceptar_Click(object sender, EventArgs e)


{
int E;
string g;
E= int.Parse(textBox1.Text);
g = textBox2.Text;
if (E >= 18)
{
if (g=="masculino")
{
lblResultado.Text = "masculino mayor de edad";
}
else
{
lblResultado.Text = "femenino mayor de edad";
}
}
else
{
if (g=="masculino")
{
lblResultado.Text = "masculino menor de edad";
}
else
{
lblResultado.Text = "femenino menor de edad";
}
}

private void btnNuevo_Click(object sender, EventArgs e)


{
textBox1.Text = "";
textBox2.Text = "";
lblResultado.Text = "Esperando resultado";
textBox1.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel Lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void textBox1_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Chocolate;
}

private void textBox2_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Red;
}
}
}
ENUNCIADO 5
Realizar un algoritmo en visual c# que permita ingresar un numero y luego presentar por pantalla su
correspondiente día de la semana.
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 Dias_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnAceptar_Click(object sender, EventArgs e)


{
int d;
d = int.Parse(txtDIA.Text);
switch(d)
{
case 1: lblResultado.Text = "lunes";
break;
case 2: lblResultado.Text = "Martes";
break;
case 3: lblResultado.Text = "Miercoles";
break;
case 4: lblResultado.Text = "Jueves";
break;
case 5: lblResultado.Text = "Viernes";
break;
case 6: lblResultado.Text = "Sabado";
break;
case 7: lblResultado.Text = "Domingo";
break;
default: lblResultado.Text ="Error";
break;
}

private void btnNuevo_Click(object sender, EventArgs e)


{
txtDIA.Text = "";
lblResultado.Text = "Esperando resultado";
txtDIA.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel Lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void lblAutor_Click(object sender, EventArgs e)


{
}

private void timer1_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void timer2_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void txtDIA_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Chocolate;
}
}
}
ENUNCIADO 6
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular el área y el
perímetro de un circulo.
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 Circulo_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender, EventArgs e)


{
double pi = 3.1416, r, a, p;
r = double.Parse(txtRadio.Text);
a = 3.1416 * r * r;
p = 2 * 3.1416 * r;
txtArea.Text = a.ToString("F2");
txtPerimetro.Text = p.ToString("F2");

private void btnNuevo_Click(object sender, EventArgs e)


{
txtRadio.Text = "";
txtArea.Text = "";
txtPerimetro.Text = "";
txtRadio.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel Lapo 3A Informatica", "Realizado por:");
this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void lblFecha_Click(object sender, EventArgs e)


{

private void timer2_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}
private void txtRadio_TextChanged(object sender, EventArgs e)
{
lblAutor.ForeColor = System.Drawing.Color.Red;
}

private void txtArea_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Black;
}

private void txtPerimetro_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Chocolate;
}
}
}
ENUNCIADO 7
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular el área y el
perímetro de un cuadrado.
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 Cuadraro_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnAceptar_Click(object sender, EventArgs e)


{
int l,a,p;
l = int.Parse(txtLado.Text);
a = l + l;
p = 4 * l;
txtArea.Text=a.ToString("F2");
txtPerimetro.Text=p.ToString("F2");

private void btnNuevo_Click(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Azure;
txtLado.Text = "";
txtArea.Text = "";
txtPerimetro.Text = "";
txtLado.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel Lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void lblFecha_Click(object sender, EventArgs e)


{

private void timer2_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void txtLado_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Red;
}

private void txtArea_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Black;
}

private void txtPerimetro_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Chocolate;
}
}
}
ENUNCIADO 8
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular el área y el
perímetro de un rectángulo.
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 Rectangulo_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void textBox2_TextChanged(object sender, EventArgs e)


{

private void btnAceptar_Click(object sender, EventArgs e)


{
int a, p, b, h;
b = int.Parse(txtbase.Text);
h = int.Parse(txtAltura.Text);
a = b * h;
p = (b + h) * 2;
txtArea.Text = a.ToString("F2");
txtPerimetro.Text = p.ToString("F2");

private void btnNuevo_Click(object sender, EventArgs e)


{
txtbase.Text = "";
txtAltura.Text = "";
txtArea.Text = "";
txtPerimetro.Text = "";
txtbase.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel Lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}
private void txtbase_TextChanged(object sender, EventArgs e)
{
lblAutor.ForeColor = System.Drawing.Color.Red;
}

private void txtAltura_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.BlueViolet;
}
}
}
ENUNCIADO 9
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular el área y el
perímetro de un triangulo equilatero.
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 TrianguloEquilatero_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender, EventArgs e)


{
float a, p, b, h, l;
b = float.Parse(txtbase.Text);
h = float.Parse(txtAltura.Text);
l = float.Parse(txtLado.Text);
a = b * h / 2;
p = l * 3;
txtArea.Text = a.ToString("F2");
txtPerimetro.Text = p.ToString("F2");
}

private void btnNuevo_Click(object sender, EventArgs e)


{
txtbase.Text = "";
txtAltura.Text = "";
txtLado.Text = "";
txtArea.Text = "";
txtPerimetro.Text = "";
txtbase.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel Lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void txtbase_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Red;
}

private void txtAltura_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.BlueViolet;
}

private void txtLado_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Chocolate;
}
private void timer1_Tick(object sender, EventArgs e)
{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void timer2_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void lblHora_Click(object sender, EventArgs e)


{

private void label2_Click(object sender, EventArgs e)


{

private void Form1_Load(object sender, EventArgs e)


{

}
}
}

ENUNCIADO 10
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular una regla de 3
simple directa.
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 ReglaDe3Directa_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender, EventArgs e)


{
double a, b, c, x;
a = double.Parse(txt1.Text);
b = double.Parse(txt2.Text);
c = double.Parse(txt3.Text);
x = b*c / a;
txt4.Text = x.ToString("F2");

private void btnNuevo_Click(object sender, EventArgs e)


{
txt1.Text = "";
txt2.Text = "";
txt3.Text = "";
txt4.Text = "";
txt1.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void txt1_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Red;
}

private void txt2_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.BlueViolet;

private void txt3_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Chocolate;
}

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}
}
}
ENUNCIADO 11
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular una regla de 3
simple inversa.
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 ReglaDe3Inversa_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender, EventArgs e)


{
double a, b, c, x;
a = double.Parse(txt1.Text);
b = double.Parse(txt2.Text);
c = double.Parse(txt3.Text);
x = a * b / c;
txt4.Text = x.ToString("F2");

private void btnNuevo_Click(object sender, EventArgs e)


{
txt1.Text = "";
txt2.Text = "";
txt3.Text = "";
txt4.Text = "";
txt1.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void txt1_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.Red;
}

private void txt2_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.BlueViolet;
}

private void txt3_TextChanged(object sender, EventArgs e)


{
lblAutor.ForeColor = System.Drawing.Color.DarkTurquoise;
}

private void timer1_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void timer2_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}
}
}
ENUNCIADO 12
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular el interés simple
de un préstamo.
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 Interes_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender, EventArgs e)


{
double capital, tiempo, porcentaje, interes, total, cuotas;
capital = double.Parse(txbCapital.Text);
tiempo = Convert.ToDouble(txbTiempo.Text);
porcentaje = double.Parse(txbPorcentaje.Text);
interes = capital * tiempo * porcentaje / 100;
total = capital + interes;
cuotas = total / tiempo;
txbInteres.Text = interes.ToString("f2");
txbTotal.Text = total.ToString("F2");
txbCuotas.Text = cuotas.ToString("f2");
lblAUTOR.Visible = true;

private void btnNuevo_Click(object sender, EventArgs e)


{
txbCapital.Text = " ";
txbTiempo.ResetText();
txbPorcentaje.Text = "";
txbInteres.Text = "";
txbTotal.Text = "";
txbCuotas.Text = "";
txbCapital.Focus();
//lblAUTOR.Visible = false;

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void txbCapital_TextChanged(object sender, EventArgs e)


{
lblAUTOR.Visible = true;
lblAUTOR.ForeColor = System.Drawing.Color.Red;
}

private void txbTiempo_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.Black;
}

private void txbPorcentaje_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.Chocolate;
}
}
}

ENUNCIADO 13
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular el interés
compuesto en un préstamo anual.
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 InteresCompuesto_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender, EventArgs e)


{
double c,p,t,inte,tr;
c = double.Parse(txb1.Text);
p = double.Parse(txb2.Text);
t = double.Parse(txb3.Text);
inte=c+t;
tr = c + inte;
txb4.Text = inte.ToString("F2");
txb5.Text = tr.ToString("F2");
}

private void btnNuevo_Click(object sender, EventArgs e)


{
txb1.Text = "";
txb2.Text = "";
txb3.Text = "";
txb4.Text = "";
txb5.Text = "";
txb1.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void txb1_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.Red;
}

private void txb2_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.BlueViolet;
}

private void txb3_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.BurlyWood;
}

private void timer1_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void timer2_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}
}
}

ENUNCIADO 14
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular la aceleración en
el movimiento uniformemente variado.
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 Aceleracion_Lapo_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalcular_Click(object sender, EventArgs e)


{
float a, vi, vf, t;
vi = float.Parse(txb1.Text);
vf = float.Parse(txb2.Text);
t = float.Parse(txb3.Text);
a = vf - vi / t;
txb4.Text = a.ToString("F2");

private void btnNuevo_Click(object sender, EventArgs e)


{
txb1.Text = "";
txb2.Text = "";
txb3.Text = "";a
txb4.Text="";
txb1.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void txb1_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.Red;
}

private void txb2_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.BlueViolet;
}

private void txb3_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.CadetBlue;
}

private void timer1_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void timer2_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}
}
}

EN
U
N
CI
A
D
O 15
Realizar un algoritmo en visual c# que permita ingresar los datos necesarios para calcular la velocidad en el
movimiento uniformemente variado.
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 VELOCIDAD1_LAPO_3A
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)


{

}
private void
button1_Click(object
sender, EventArgs e)
{
string usuario, clave;
usuario =
txbusuario.Text;
clave = txbclave.Text;
if (usuario == "lapo")
{
if (clave == "2005")
{
this.Hide();
velocidad v = new
velocidad();
v.Show();
}
else
{
//Error.visible==true;
ERROR.Image = VELOCIDAD1_LAPO_3A.Properties.Resources.ERROR;
}
}
}

private void button3_Click(object sender, EventArgs e)


{
MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");
this.Close();
}

private void btnnuevo_Click(object sender, EventArgs e)


{
txbusuario.Text = "";
txbclave.Text = "";
txbusuario.Focus();
}
}
}

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

private void btnCalcular_Click(object sender, EventArgs e)


{
float v, d, t;
d = float.Parse(txb1.Text);
t = float.Parse(txb2.Text);
v = d / t;
txb3.Text = v.ToString("F2");

private void btnNuevo_Click(object sender, EventArgs e)


{
txb1.Text = "";
txb2.Text = "";
txb3.Text = "";
txb1.Focus();
}

private void btnSalir_Click(object sender, EventArgs e)


{

MessageBox.Show("Angel lapo 3A Informatica", "Realizado por: ");


this.Close();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblFecha.Text = DateTime.Now.ToLongDateString();
}

private void timer2_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToString("hh:mm:ss");
}

private void txb1_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.Red;
}

private void txb2_TextChanged(object sender, EventArgs e)


{
lblAUTOR.ForeColor = System.Drawing.Color.Chocolate;
}
}
}

You might also like