1. Point “Galones Litros”
Double G, Litros for G=100 to 200 step 10
{
Litros = G* 3.785
Print G, Litros
}
fin
namespace practica8problema1C
{
class Program
{
static void Main(string[] args)
{double G, Litros;
Console.WriteLine("GALONES LITROS");
for (G = 100; G <= 200; G = G + 10)
{
Litros = G * 3.785;
Console.WriteLine("{0} \t\t {1}", G, Litros);
}
Console.ReadKey();
}
}
}

namespace practica8problema1V
{
public partial class Form1 : Form
{
double G, Litros;
public Form1()
{
InitializeComponent();
G = 0.0;
Litros = 0.0;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
for (G = 100; G <= 200; G = G + 10)
{
Litros = G * 3.785;
listBox1.Items.Add("Galones\t" + G + "\tLitros\t" + Litros);
}
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
}
}
No hay comentarios:
Publicar un comentario