Vous êtes sur la page 1sur 4

namespace practica_01_algoritmosII

{
public partial class ejercicio7 : Form
{
public ejercicio7()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
int st = Convert.ToInt32(textBox1.Text);
int h, min, seg;
h = st / 3600;
min = (st - h * 3600) / 60;
seg = st - (h * 3600 + min * 60);
textBox2.Text = h.ToString();
textBox3.Text = min.ToString();
textBox4.Text = seg.ToString();
}
}
}
namespace practica_01_algoritmosII
{
public partial class ejercicio8 : Form
{
public ejercicio8()
{
InitializeComponent();
}

private void button2_Click(object sender, EventArgs e)


{
double m = Convert.ToDouble(textBox1.Text);
double min = Convert.ToDouble(textBox2.Text);
double seg= Convert.ToDouble(textBox3.Text);
double cs = Convert.ToDouble(textBox4.Text);
double Dkm, Th , Vp;
Dkm = m / 1000;
Th = (min / 60) + (seg / 3600) + (cs / 360000);
Vp = Dkm / Th;
textBox5.Text = Math.Round(Vp,3).ToString();
}
}
}