miércoles, 23 de septiembre de 2009
jueves, 17 de septiembre de 2009
Practica 5
namespace Practica_5_Consola
Windows.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;using System.Text;
using System.Windows.Forms;
namespace Practica_5_Windows
{
public partial class Form1 : Form
{
double Costtotal, costo;
public Form1()
{
InitializeComponent();
Costtotal = costo = 0;
}
private void CALCULAR_Click(object sender, EventArgs e)
{
costo = double.Parse(textBox1.Text);
Costtotal = costo + costo * 0.12 + costo * 0.06;
textBox2.Text = Costtotal.ToString();
private void CLEAR_Click(object sender, EventArgs e)
{
}
textBox1.Clear();
textBox2.Clear();
textBox1.Focus(); }
private void CLOSE_Click(object sender, EventArgs e)
{
Close(); } }}
Practica 4
using System;
using System.Collections.Generic;using System.Text;
namespace Practica_4_Consola
{
class Program
{
static void Main(string[] args)
{
int Dist, Vel, Tiem;
Console.WriteLine("Programa que calcula la distancia en millas");
Console.WriteLine("Realizado por Ing. Ruiz Morales S.");
Console.WriteLine("Introduce valor entero que represente la Velocidad de viaje");
Vel = int.Parse(Console.ReadLine());
Console.WriteLine("Introduce valor entero que represente el tiempo transcurrido");
Tiem = int.Parse(Console.ReadLine());
Dist = Vel * Tiem;
Console.WriteLine("La distancia total es {0} millas", Dist);
Console.ReadKey(); } }}
Windows.
using System;
using System.Collections.Generic;using System.ComponentModel;
using System.Data;using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Practica_4_Windows
{
public partial class Form1 : Form
{
int Dist, Vel, Tiem;
public Form1()
{
InitializeComponent();
Dist = Vel = Tiem = 0;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void CALCULAR_Click(object sender, EventArgs e)
{
Vel = int.Parse(textBox1.Text);
Tiem = int.Parse(textBox2.Text);
Dist = Vel * Tiem;
textBox3.Text = Dist.ToString();
}
private void CLEAR_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox1.Focus();
}
private void SALIR_Click(object sender, EventArgs e)
{
Close(); } }}