martes, 4 de noviembre de 2008

Practica 10

Problema 1

using System;
using System.Collections.Generic;
using System.Text;
namespace Examen_1al_99
{
class Program
{
static void Main(string[] args)
{
double I;
Console.WriteLine("Numero" + " Cuadrado");
for (I = 1; I <= 99; I = I + 2)
{
Console.WriteLine("" + I + "\t " + I * I);
}
Console.ReadLine();
}
}
}













Problema 2

using System;
using System.Collections.Generic;
using System.Text;
namespace Examen_xy
{
class Program
{
static void Main(string[] args)
{
double x, y;
Console.WriteLine("X" + " \t Y");
for (x = 5; x <= 10; x = x + 0.02)
{ y = (3 * x * x * x - 2 * x * x + x);
Console.WriteLine("" + x + " \t " + y); }
Console.ReadLine();
}
}
}








Problema 3

using System;
using System.Collections.Generic;
using System.Text;
namespace Examen_2_al_200
{
class Program
{
static void Main(string[] args)
{
double I, suma;
suma = 0;
for (I = 2; I <= 200; I = I + 2)

{ suma = suma + I; if (I >= 200)
{
Console.WriteLine("La suma es: {0}", suma);
}
}
Console.ReadLine();
}
}
}














Problema 4

using System;
using System.Collections.Generic;
using System.Text;
namespace Examen_grados
{
class Program
{
static void Main(string[] args)
{
double vinicial, vfinal, celcius, I;
Console.WriteLine("Introduce la temperatura inicial en grados fahrenheit");
vinicial = double.Parse(Console.ReadLine());
Console.WriteLine("Introduce el valor final en grados fahrenheit");
vfinal = double.Parse(Console.ReadLine());
Console.WriteLine("\nFahrenheit" + "\t Celcius");
for (I = vinicial; I <= vfinal; I = I + 2) { celcius = (5.0 / 9.0) * (I - 32);
Console.WriteLine("" + I + " " + celcius); }
Console.ReadLine();
}
}
}








No hay comentarios: