Codigo:
namespace practica_5_problema_1_visual
{
public partial class Form1 : Form
{
double m, g, r;
public Form1()
{
InitializeComponent();
m = g = r = 0.0;
}
private void button1_Click(object sender, EventArgs e)
{
m = double.Parse(textBox1.Text);
g = double.Parse(textBox2.Text);
r = m / g;
label3.Text = ("El rendimiento en millas por galon=" + r);
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
label3.Text = " ";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKV-xHCdvCMfvNccnCjNSZGT4PcAz8_iAS-hkUZyjMVse2KcAfuVGUcFQxluTQuZnxotu3dBDT4kDmD12PdY9KKDw3gUgvLyAa4NrQHNdc-EfH7fmKA38YZfuTWhtnO-QGjng7V1SwMAX9/s400/practica+5+problema+1.png)
Practica 5 Problema 2
Codio:
namespace practica_5_problema_2_visual
{
public partial class Form1 : Form
{
double a, b, c, x, poli;
public Form1()
{
InitializeComponent();
a = b = c = poli = 0.0;
}
private void button1_Click(object sender, EventArgs e)
{
a = double.Parse(textBox1.Text);
b = double.Parse(textBox2.Text);
c = double.Parse(textBox3.Text);
x = double.Parse(textBox4.Text);
poli = (a * Math.Pow(x, 2)) + (b * x) + c;
label5.Text = ("El valor del polinomio es="+poli);
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
label5.Text = " ";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0827iqSPmbs2jHWxgNie9Fm493px0bhgw9HUWXxa0a99Bk3Leu6n18uqfva_v69zBpvI804e5WbaGLs1ZqCWMvBE6ReiLhdrYLl26QCFwyR3Z44MTRqo-oDQ_Cw5gtvDkG7fz2u_Jvtf9/s400/practica+5+problema+2.png)
Practica 5 Problema 3
Codigo:
namespace practica_5_problema_3_visual
{
public partial class Form1 : Form
{
double angulo;
public Form1()
{
InitializeComponent();
angulo = 0.0;
}
private void button1_Click(object sender, EventArgs e)
{
angulo = double.Parse(textBox1.Text);
if (angulo < 90)
{
label2.Text = ("El angulo es agudo");
}
else
{
if (angulo == 90)
{
label2.Text=("El angulo es recto");
}
else
{
if (angulo > 90)
{
label2.Text=("El angulo es obtuso");
}
}
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
label2.Text = " ";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0SI6qBouvWsWghoyFICPTnubu2fLC4vxwct-Jt0xeSJ3a8BlO0xnSjZ_1m30viPxIgiJL6YiQMRvR6C9egXnZevW_-CDxZwibnPpPi2SUrP85isG4fxX4Flq2SnyS3QM3iSp6Y6bqJ181/s400/practica+5+problema+3.png)
Practica 5 Problema 4
Codigo:
namespace practica_5_problema_4_visual
{
public partial class Form1 : Form
{
double c1, c2, c3, c4, c5, promedio;
string nombre;
public Form1()
{
InitializeComponent();
nombre = " ";
c1 = c2 = c3 = c4 = c5 = 0.0;
}
private void button1_Click(object sender, EventArgs e)
{
nombre = textBox1.Text;
c1 = double.Parse(textBox2.Text);
c2 = double.Parse(textBox3.Text);
c3 = double.Parse(textBox4.Text);
c4 = double.Parse(textBox5.Text);
c5 = double.Parse(textBox6.Text);
promedio = (c1 + c2 + c3 + c4 + c5) / 5;
label15.Text = ("Promedio General="+promedio);
if (promedio < 70)
{
label16.Text = ("La presente boleta certifica que el alumno(a) " + nombre);
label17.Text = (" no acredito el segundo semestre");
}
else
{
if (promedio >= 70)
{
label16.Text = ("La presente boleta certifica que el alumno(a) " + nombre);
label17.Text = (" acredito el segundo semestre");
}
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
textBox6.Clear();
label15.Text = " ";
label16.Text = " ";
label17.Text = " ";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUHUAEHNEuGplUbE01iNFgfsGbvvm35Zc_HWVQ6UkAlxP-iJR7E1cz9Y7xJMcfVFTXbUtky7nKqEqK84ZTrFb58NTSy8niSNV_xUVV2bHtGA7V8okoIC4jFMsc9O5dSgE2h7MqUNCLdF0n/s400/practica+5+problema+4.png)
Practica 5 Problema 5
Codigo:
namespace practica_5_problema_5_visual
{
public partial class Form1 : Form
{
double n1, n2, n3, n4, n5, mayor;
public Form1()
{
InitializeComponent();
n1 = n2 = n3 = n4 = n5 = 0.0;
}
private void button1_Click(object sender, EventArgs e)
{
n1 = double.Parse(textBox1.Text);
n2 = double.Parse(textBox2.Text);
n3 = double.Parse(textBox3.Text);
n4 = double.Parse(textBox4.Text);
n5 = double.Parse(textBox5.Text);
if (n1 >= n2 && n1 >= n3 && n1 >= n4 && n1 >= n5)
{
mayor = n1;
}
else
{
if (n2 >= n1 && n2 >= n3 && n2 >= n4 && n2 >= n5)
{
mayor = n2;
}
else
{
if (n3 >= n1 && n3 >= n2 && n3 >= n4 && n3 >= n5)
{
mayor = n3;
}
else
{
if (n4 >= n1 && n4 >= n2 && n4 >= n3 && n4 >= n5)
{
mayor = n4;
}
else
{
mayor = n5;
}
}
}
}
label6.Text = ("El numero mayor es ="+mayor);
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
label6.Text = " ";
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitOCbnmLj1QjyUhjHu7Z9a9Cl8KllZKaaeY7dCNKUFi4V0w0CYTAcshtzfIZzg-hTtBmPLeIzGlb3IaV_uODDEiF4Q628nSiyXiSl3iY791BC_Kq6IjT0RaitxN7Wdhu6Ij0DrMifEx5Oo/s400/practica+5+problema+5.png)