Está en la página 1de 2

SOLUCIÓN GUÍA 1

PROGRAMACIÓN/QUINTO BACH

TEMAS ANTES DE REALIZAR LA PRÁCTICA


Que es Visual Studio.
o Framework, https://www.espaciohonduras.net/microsoft-visual-studio-
concepto-y-que-es-y-para-que-sirve-microsoft-visual-studio
o Interfaz Visual Studio,
https://www.ingenieriasystems.com/2012/10/programacion-plataforma-
desktop-vb-net_297.html

• Formularios en VS – C#
https://learn.microsoft.com/es-es/visualstudio/ide/create-csharp-winform-
visual-studio?view=vs-2022
o Controles VS – C#}
o Objetos
o Propiedades.
o Eventos.
• Variables.
o Tipos de Datos,
https://slideplayer.es/slide/3594088/12/images/8/Tipos+de+Datos+por+Valor.j
pg
• Operadores.
o Tipos de Operadores
• Constantes.
Ejercicio 1:

Label TextBox

Timer
Button

Control Propiedad Escribir


Label 1 Text Fecha:
Label 2 Text Grados Centígrados:
Label 3 Text Grados Fahrenheit:
TextBox1 Text Generar Fecha
TextBox1 Enabled False
TextBox2 Text 0.00
TextBox3 Text 32.00
Button1 Text Convertir
Button2 Text Convertir
Timer1 Enabled True
Timer1 Intervalo 1000

Formulas:
Centígrados=(F-32)/1.8
Fahrenheit=(C * 1.8)+32

Código del Ejercicio resuelto

Solución del ejercicio…

namespace SOLUCIÓN_G1___UNIDAD_I
{
public partial class Form1 : Form
{
//----------------------------------------------------------------
//Variables Publicas
double resFahrenheit, resCentigrado, fahren , cent;
//----------------------------------------------------------------
public Form1()
{
InitializeComponent();
}
//---------------------------------------------------------------
private void tmrfecha_Tick(object sender, EventArgs e)
{
//Muestra la fecha en la caja de texto Fecha, invocada desde el sistema
txtFecha.Text = DateTime.Now.ToLongDateString();
}
//---------------------------------------------------------------
private void btnCentigrados_Click(object sender, EventArgs e)
{
//capturar el dato escrito en la caja de texto Centigrados
cent = Convert.ToDouble(txtCentigrados.Text);
resFahrenheit = (cent * 1.8) + 32;//Se calcula con la fórmula
txtFahrenheit.Text = resFahrenheit.ToString();
//Se envia el resultado en la caja de Fahrenheit
}
//---------------------------------------------------------------
private void btnFahrenheit_Click(object sender, EventArgs e)
{
//capturar el dato escrito en la caja de texto de Fahrenheit
fahren = Convert.ToDouble(txtFahrenheit.Text );
resCentigrado = (fahren - 32) / 1.8;//Se calcula con la fórmula
txtCentigrados.Text = resCentigrado.ToString();
//Se envia el resultado en la caja de centigrado
}
//---------------------------------------------------------------
}
}

DICHO EJERCICIO ESTÁ ORIENTADO EN LOS TEMAS VISTOS CON DESCRITOS AL INICIO DEL DOCUMENTO.

Ejercicio 2:
https://forms.gle/6Kvo2vzf6cUHxJVk7

También podría gustarte