sábado, 24 de octubre de 2009

PRACTICA 5.4



{
class Program
{
static void Main(string[] args)
{
double t, rad, x, y;
t = 0;
rad = Math.PI * 22.8 / 180;
Console.WriteLine("\ntiempo \tvalor de x \t\tvalor de y");
while(t<10)
{
x = 500 * t * Math.Cos(rad);
y = 500 * t * Math.Sin(rad);
Console.WriteLine("{0} \t{1} \t{2} ", t, x, y);
t = t + 0.5;
}
Console.ReadLine();



PRACTICA EN WINDOWS

namespace practica_5._8_windows
{
public partial class Form1 : Form
{
double T, RAD, X, Y;
public Form1()
{
T = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double T, RAD, X, Y;
T = 0;
RAD = Math.PI * 22.8 / 180;
listBox1.Items.Add("TIEMPO \tVALOR DE X \t\tVALOR DE Y");
do
{
X = 500 * T * Math.Cos(RAD);
Y = 500 * T * Math.Sin(RAD);
listBox1.Items.Add(T.ToString() + "\t" + X.ToString() + "\t\t" + Y.ToString());
T=T+ 1.0/2.0;
}
while(T<=10); } private void button2_Click(object sender, EventArgs e) { listBox1.Items.Clear(); } private void button3_Click(object sender, EventArgs e) { Close(); } private void listBox1_SelectedIndexChanged(object sender, EventArgs e)





PRACTICA 5 PROBLEMA 3




class Program
{
static void Main(string[] args)
{
int num, anum, dig;
Console.WriteLine("\n\nintroduce un valor entero");
num = int.Parse(Console.ReadLine());
anum = num;
do
{
dig = anum % 10;
Console.WriteLine("\ndigito {0}", dig);
anum = anum / 10;
}
while (anum != 0);
Console.ReadLine();
}
}


PRACTICA EN WINDOWS


namespace practica_5._7_windows
{
public partial class Form1 : Form
{
int num, anum, dig;
public Form1()
{
num= anum= dig=0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int num, anum, dig;
num = int.Parse(textBox1.Text);
anum = num;
do
{
dig = anum % 10;
listBox1.Items.Add("digito\t " + dig.ToString());
anum = anum / 10;
}
while (anum != 0);
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}

PRACTICA 5.2 D



namespace practica_5._6_console
{
class Program
{
static void Main(string[] args)
{
int c1, er;
c1 = 0;
er = 0;
do
{
Console.WriteLine(" \n Introduce Calificacion");
c1 = int.Parse(Console.ReadLine());
if (c1 <> 100)
{
er = er + 1;
}
}
while (er < 5);
Console.ReadLine();
}


PRACTICA EN WINDOWS



public partial class Form1 : Form
{
int c1, er;
public Form1()
{
c1 = 0;
er = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 <> 100)
{
listBox1.Items.Add(c1.ToString());
er = er + 1;
}
else
{
listBox1.Items.Add(c1);
}
if (er > 5)
{ Close(); }



PRACTICA 5.2 C




class Program
{
static void Main(string[] args)
{
int cl;
do
{
Console.WriteLine("introduce calificacion");
cl = int.Parse(Console.ReadLine());
Console.WriteLine("la calificacion:{0}", cl);
if (cl <> 100)
Console.WriteLine("calificacion incorrecta");
}
while (cl != 999);
Console.Read();


PRACTICA EN WINDOWS




namespace practica_5._5_windows
{
public partial class Form1 : Form
{
int c1, codigo = 999;
public Form1()
{
c1 = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 == codigo)
Close();
if (c1 <> 100)
{
textBox1.Enabled = false;
listBox1.Items.Add("Calificacion Incorrecta");
}
else
{
listBox1.Items.Add(c1);
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();

PRACTICA 5.2 B



class Program
{
static void Main(string[] args)
{
int cl;
do
{
Console.WriteLine("introduce calificacion");
cl = int.Parse(Console.ReadLine());
Console.WriteLine("la calificacion:{0}", cl);
if (cl <> 100)
Console.WriteLine("calificacion incorrecta");
}
while (cl != 999);
Console.Read();
}

PRACTICA EN WINDOWS


namespace practica_5._5_windows
{
public partial class Form1 : Form
{
int c1, codigo = 999;
public Form1()
{
c1 = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 == codigo)
Close();
if (c1 <> 100)
{
textBox1.Enabled = false;
listBox1.Items.Add("Calificacion Incorrecta");
}
else
{
listBox1.Items.Add(c1);
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void Form1_Load(object sender, EventArgs e)
{








practica 5.2 A

practica 5.1 A consola y windows

consola










namespace practica_5._2_consola
{
class Program
{
static void Main(string[] args)
{
int cl;
do{
Console.WriteLine("introduce calificacion");
cl= int.Parse(Console.ReadLine());
Console.WriteLine("la calificacion:{0}",cl);
}
while(cl>=0 cl <=100); Console.Read();

practica en windows

namespace practica_5._3_windows
{
public partial class Form1 : Form
{
int c1;
public Form1()
{
c1 = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
c1 = int.Parse(textBox1.Text);
if (c1 <> 100)
{
textBox1.Enabled = false;
}
else
{
listBox1.Items.Add(c1);
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Enabled = true;
textBox1.Clear();
listBox1.Items.Clear();
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}


practica 4.4 pies a metros



imagen


programa


class Program
{
static void Main(string[] args)
{
double pies,metros;
pies=2.0;
Console.WriteLine("pies\t\tmetros");
while (pies <= 20.0) { metros = pies/3.28; Console.WriteLine("{0}\t\t{1}", pies,metros); pies=pies+2; } Console.ReadKey();


practica en windows



public partial class Form1 : Form
{
double pies, metro;
public Form1()
{
pies = 2.0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add("pies metros");
while (pies <= 20.0) { metro = pies / 3.28; listBox1.Items.Add(pies.ToString() + " " + metro.ToString()); pies = pies + 2.0; }