static void Main(string[] args)
{
//datos {
Console.WriteLine("Inserte la velocidad de la liebre: ");
double V = double.Parse(Console.ReadLine());
Console.WriteLine("Inserte el tiempo transcurrido horas: ");
double T= double.Parse(Console.ReadLine());
//caculamos
double E=V*T;
//escribinos resultados
Console.WriteLine("El espacio recorrido por la libre es: "+ Math.Round(E,2) + " KM");
private void btnCalcular_Click(object sender, EventArgs e)
{
//declarar Variables
int t, v, espacio;
//leer datos}
t = int.Parse(txtTiempo.Text);
v = int.Parse(txtVelocidad.Text);
//procesos
espacio = v * t;
//escribir resultado
txtEspacio.Text = espacio.ToString();
}
private void btnNuevo_Click(object sender, EventArgs e)
{
txtEspacio.Text = string.Empty;
txtTiempo.Text = string.Empty;
txtVelocidad.Text = string.Empty;
txtVelocidad.Focus();
No hay comentarios:
Publicar un comentario