domingo, 24 de noviembre de 2013

MENU CON VECTORES


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace VECTORES
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c;
            double [] d,e,f;
             string aux;
             d = new double[5];
             e = new double[5];
             f = new double[5];
             do
             {
                 Console.Clear();
                 Console.SetCursorPosition(19, 3);
                 Console.Write("M  E  N  U");
                 Console.SetCursorPosition(10, 5);
                 Console.Write("1.- LLENAR VECTOR");
                 Console.SetCursorPosition(10, 6);
                 Console.Write("2.- LLENAR VECTOR 2 CON LA CUARTA DEL PRIMERO");
                 Console.SetCursorPosition(10, 7);
                 Console.Write("3.- LLENAR EL 3 VECTOR CON A*B");
                 Console.SetCursorPosition(10, 8);
                 Console.Write("4.- SALIR");
                 Console.SetCursorPosition(10, 10);
                 Console.Write("QUE OPCION DESEAS  ");
                 aux = Console.ReadLine();
                 a = int.Parse(aux);
                 Console.Clear();
                 switch (a)
                 {
                     case 1:
                         {
                            
                             Console.SetCursorPosition(10, 6);
                             Console.Write("LLENADO DEL VECTOR");
                             Console.SetCursorPosition(10, 8);
                             Console.Write("**********");
                             Console.SetCursorPosition(10, 9);
                             Console.Write("*        *");
                             Console.SetCursorPosition(10, 10);
                             Console.Write("**********");
                             Console.SetCursorPosition(10, 11);
                             Console.Write("*        *");
                             Console.SetCursorPosition(10, 12);
                             Console.Write("**********");
                             Console.SetCursorPosition(10, 13);
                             Console.Write("*        *");
                             Console.SetCursorPosition(10, 14);
                             Console.Write("**********");
                             Console.SetCursorPosition(10, 15);
                             Console.Write("*        *");
                             Console.SetCursorPosition(10, 16);
                             Console.Write("**********");
                             Console.SetCursorPosition(10, 17);
                             Console.Write("*        *");
                             Console.SetCursorPosition(10, 18);
                             Console.Write("**********");
                             b = 9;
                             for (c = 0; c < 5; c++)
                             {
                                 Console.SetCursorPosition(3, b);
                                 Console.Write("d[ " + c + " ]");
                                 Console.SetCursorPosition(12, b);
                                 aux = Console.ReadLine();
                                 d[c] = int.Parse(aux);
                                
                                 b = b + 2;
 
                             }
 
                             Console.ReadKey();
                             break;
                         }
                     case 2:
                          {
                              Console.SetCursorPosition(15, 6);
                              Console.Write("A");
                              Console.SetCursorPosition(10, 8);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 9);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 10);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 11);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 12);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 13);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 14);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 15);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 16);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 17);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 18);
                              Console.Write("**********");
                              Console.SetCursorPosition(43, 6);
                              Console.Write("E^4");
                              Console.SetCursorPosition(40, 8);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 9);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 10);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 11);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 12);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 13);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 14);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 15);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 16);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 17);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 18);
                              Console.Write("**********");
                              b = 9;
                              for (c = 0; c < 5; c++)
                              {
                                  Console.SetCursorPosition(3, b);
                                  Console.Write("d[ " + c + " ]");
                                  Console.SetCursorPosition(12, b);
                                  Console.Write(d[c]);
                                  e[c]= Math.Pow(d[c], 4);
Console.SetCursorPosition(30, b);
                                  Console.Write("e[ " + c + " ]");
                                  Console.SetCursorPosition(43, b);
                                  Console.Write(e[c]);
                                  b = b + 2;
                              }
                              Console.ReadKey();
                              break;
                          }
                     case 3:
                          {
                              Console.SetCursorPosition(15, 6);
                              Console.Write("D");
                              Console.SetCursorPosition(10, 8);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 9);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 10);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 11);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 12);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 13);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 14);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 15);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 16);
                              Console.Write("**********");
                              Console.SetCursorPosition(10, 17);
                              Console.Write("*        *");
                              Console.SetCursorPosition(10, 18);
                              Console.Write("**********");
 
 
                              Console.SetCursorPosition(43, 6);
                              Console.Write("E=D^4");
                              Console.SetCursorPosition(40, 8);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 9);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 10);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 11);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 12);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 13);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 14);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 15);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 16);
                              Console.Write("**********");
                              Console.SetCursorPosition(40, 17);
                              Console.Write("*        *");
                              Console.SetCursorPosition(40, 18);
                              Console.Write("**********");
 
                              Console.SetCursorPosition(60, 6);
                              Console.Write("F = D * E");
                              Console.SetCursorPosition(60, 8);
                              Console.Write("**********");
                              Console.SetCursorPosition(60, 9);
                              Console.Write("*        *");
                              Console.SetCursorPosition(60, 10);
                              Console.Write("**********");
                              Console.SetCursorPosition(60, 11);
                              Console.Write("*        *");
                              Console.SetCursorPosition(60, 12);
                              Console.Write("**********");
                              Console.SetCursorPosition(60, 13);
                              Console.Write("*        *");
                              Console.SetCursorPosition(60, 14);
                              Console.Write("**********");
                              Console.SetCursorPosition(60, 15);
                              Console.Write("*        *");
                              Console.SetCursorPosition(60, 16);
                              Console.Write("**********");
                              Console.SetCursorPosition(60, 17);
                              Console.Write("*        *");
                              Console.SetCursorPosition(60, 18);
                              Console.Write("**********");
                              b = 9;
                              for (c = 0; c < 5; c++)
                              {
                                  Console.SetCursorPosition(3, b);
                                  Console.Write("d[ " + c + " ]");
                                  Console.SetCursorPosition(12, b);
                                  Console.Write(d[c]);
                                
                                  Console.SetCursorPosition(30, b);
                                  Console.Write("e[ " + c + " ]");
                                  Console.SetCursorPosition(43, b);
                                  Console.Write(e[c]);
                                  f[c] = d[c] * e[c];
                                  Console.SetCursorPosition(53, b);
                                  Console.Write("f[ " + c + " ]");
                                  Console.SetCursorPosition(63, b);
                                  Console.Write(f[c]);
 
                                  b = b + 2;
                              }
                              Console.ReadKey();
                             
                              break;
                          }
 
                 }
 
 
             }
             while (a != 4);
 
        }
    }
}

No hay comentarios:

Publicar un comentario