jueves, 12 de noviembre de 2009

Practica 10.2 Consola



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

namespace PRACTICA_10_1C
{
class Program
{
static void Main(string[] args)
{
int[] RESISTENCIAS = { 16, 27, 39, 56, 81 };
int[] CORRIENTE = new int[5];
int[] POTENCIA = new int[5];
int TOTAL = 0;
int I;
for (I = 0; I <= 4; I = I + 1)
{
Console.WriteLine("Introduce corriente:", I + 1);
CORRIENTE[I] = int.Parse(Console.ReadLine());
POTENCIA[I] = RESISTENCIAS[I] * CORRIENTE[I] * CORRIENTE[I];
TOTAL = TOTAL + POTENCIA[I];

}
Console.WriteLine("RESISTENCIA CORRIENTE POTENCIA");
Console.WriteLine("_________________________________________________");
for (I = 0; I <= 4; I = I + 1)
{
Console.WriteLine("{0}\t\t\t{1}\t\t{2}", RESISTENCIAS[I], CORRIENTE[I], POTENCIA[I]);
}
Console.WriteLine("\n\nEl total es:{0}", TOTAL);
Console.ReadKey();
}
}
}

No hay comentarios:

Publicar un comentario