viernes, 27 de febrero de 2009

practica 2 problema 2


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace practica_1_edder_cuadrado
{
class Program
{
static void Main(string[] args)
{



double ancho, largo, costom ,totalcdescuento, pr, area;
Console.WriteLine("introduce el ancho de el terreno:");
ancho = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el largo de el terreno:");
largo = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el costo de el metro del terreno:");
costom = double.Parse(Console.ReadLine());
area = largo * ancho;
pr= largo * ancho * costom;

if (area > 500 && area <= 1000) { totalcdescuento = pr - (pr * 0.15); Console.WriteLine("Tiene 15% de descuento"); Console.WriteLine("largo={0},ancho={1},costom={2},presio={3}", largo, ancho, costom, totalcdescuento); Console.ReadKey(); } else if (area > 1000)
{
totalcdescuento = pr - (pr * 0.25);
Console.WriteLine("Tiene 25% de descuento");
Console.WriteLine("largo={0},ancho={1},costom={2},presio={3}", largo, ancho, costom, totalcdescuento);
Console.ReadKey();
}
else
{
Console.WriteLine("No tiene descuento");
Console.WriteLine("largo={0},ancho={1},costom={2},presio={3}", largo, ancho, costom, pr);
Console.ReadKey();

practica 2 problema 1 visual 1


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace practica_2_problema_1_visual
{
public partial class Form1 : Form
{
double nom;
double pro;
double c1, c2, c3, c4 ;

public Form1()
{
c1 = c2 = c3 = c4 = 0;
pro = 0;
InitializeComponent();
}


private void Form1_Load(object sender, EventArgs e)
{

}

private void tbnom_TextChanged(object sender, EventArgs e)
{

}

private void tbc1_TextChanged(object sender, EventArgs e)
{

}

private void btcalcular_Click(object sender, EventArgs e)
{
c1 = double.Parse(tbc1.Text);
c2 = double.Parse(tbc2.Text);
c3 = double.Parse(tbc3.Text);
c4 = double.Parse(tbc4.Text);
pro = (c4 + c3 + c2 + c1) / 4;

if (pro < text =" (">= 70)
{
tbpro.Text = ("pasaste ,algo bien sacaste: " +pro);
}

}







private void btlimpiar_Click(object sender, EventArgs e)
{
tbpro.Clear();
tbc4.Clear();
tbc3.Clear();
tbc2.Clear();
tbc1.Clear();
tbnom.Clear();
}

private void button1_Click(object sender, EventArgs e)
{
Close();

problema 3 visual 3


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int H, M, S, D;

public Form1()
{
H = M = S = D = 0;
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
MessageBox.Show("Introduce cantidad de horas por favor");

else
{
H = int.Parse(textBox1.Text);
M = (H * 60);
S = (H * 3600);
D = (H / 24);
listBox1.Items.Add("Horas convertidas=" + H);

listBox1.Items.Add("DIAS=" + D);

listBox1.Items.Add("MINUTOS=" + M);
listBox1.Items.Add("SEGUNDOS=" + S);

listBox1.Items.Add("");




}

}



private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();

textBox1.Focus();

listBox1.Items.Clear();

martes, 24 de febrero de 2009

problema 2 visual 2


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace practica_1_problema_2_visual
{
public partial class Form1 : Form
{

double faren, cel;
public Form1()
{
faren = cel = 0;

InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void label1_Click(object sender, EventArgs e)
{

}

private void tbfaren_TextChanged(object sender, EventArgs e)
{

}

private void btcalcular_Click(object sender, EventArgs e)
{
faren = double.Parse(tbfaren.Text);

cel = (5.0 / 9.0 * (faren - 32.0));

tbcel.Text = cel.ToString();






}

private void btlimpiar_Click(object sender, EventArgs e)
{
tbcel.Clear();
tbfaren.Clear();


}

private void btsalir_Click(object sender, EventArgs e)
{
Close();

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace practica_1_problema_1_visual
{
public partial class Form1 : Form
{
int total;
int lado, ancho, costom;
public Form1()
{
lado = ancho = costom = 0;
total = 0;

InitializeComponent();
}

private void button3_Click(object sender, EventArgs e)
{
Close();

}

private void tblargo_TextChanged(object sender, EventArgs e)
{


}

private void tbancho_TextChanged(object sender, EventArgs e)
{

}

private void tbcostom_TextChanged(object sender, EventArgs e)
{

}

private void tbtotal_TextChanged(object sender, EventArgs e)
{

}

private void btcalcular_Click(object sender, EventArgs e)
{





lado = int.Parse(tblargo.Text);
ancho = int.Parse(tbancho.Text);
costom= int.Parse(tbcostom.Text);

total= (lado * ancho * costom);

tbtotal.Text = total.ToString();




}

private void btlimpiar_Click(object sender, EventArgs e)
{
tbtotal.Clear();
tblargo.Clear();
tbancho.Clear();
tbcostom.Clear();

lunes, 16 de febrero de 2009

practica2 probl1


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace practica_2_priblema_1
{
class Program
{
static void Main(string[] args)
{
string nom;
double c1, c2, c3, c4,pro ;
Console.WriteLine("introduce el nombre del alumno");
Console.WriteLine("");

nom= Console.ReadLine();
Console.WriteLine("");

Console.WriteLine("introduce calificacion 1");
Console.WriteLine("");

c1 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce calificacion 2");
Console.WriteLine("");

c2 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce calificacion 3");
Console.WriteLine("");

c3 = double.Parse(Console.ReadLine());
Console.WriteLine("introduce calificacion 4");
Console.WriteLine("");

c4 = double.Parse(Console.ReadLine());
pro = (c1 + c2 + c3 + c4) / 4;

if (pro <>= 70 && pro<=100) { Console.WriteLine("Calificacion 1: " + c1); Console.WriteLine("Calificacion 2: " + c2); Console.WriteLine("Calificacion 3: " + c3); Console.WriteLine("Calificacion 4: " + c4); Console.WriteLine("Promedio: " + pro); Console.WriteLine("Aprobaste "); } else if(pro>100)
{

Console.WriteLine("mas de 1oo ");
}



Console.ReadKey();

practica1 probl 3


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace practica_1_problema_3
{
class Program
{
static void Main(string[] args)
{
int horas, minutos, segundos, dias;
Console.WriteLine("introduce la cantidad en horas");
horas = int.Parse(Console.ReadLine());
minutos = horas * 60;
segundos = horas * 3600;
dias = horas / 24;
Console.WriteLine("Cantidad en horas=" + horas);
Console.WriteLine("Cantidad en dias=" + dias);
Console.WriteLine("Cantidad en segundos=" + segundos);
Console.WriteLine("cantidad en minutos=" + minutos);
Console.ReadLine();

viernes, 13 de febrero de 2009

practica 1 probl 2


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace practica_1_probl_2
{
class Program
{
static void Main(string[] args)
{
double farenheit, celsius;
Console.WriteLine("introduce el valor de grados farenhrit");
farenheit = double.Parse(Console.ReadLine());
celsius = (5.0 / 9.0 * (farenheit - 32));

Console.WriteLine("farenheit={0},celsius={1}", farenheit, celsius);
Console.ReadLine();

practica 1 prol 1


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace practica_1_probl_1
{
class Program
{
static void Main(string[] args)
{
double ancho, largo, costom;
Console.WriteLine("introduce el ancho de el terreno:");
ancho = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el largo de el terreno:");
largo = double.Parse(Console.ReadLine());
Console.WriteLine("introduce el costo de el metro del terreno:");
costom = double.Parse(Console.ReadLine());
double presio = largo * ancho * costom;
Console.WriteLine("largo={0},ancho={1},costom={2},presio={3}", largo, ancho, costom, presio);
Console.ReadLine();