ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Trabajo de vectores de programacion en c#


Enviado por   •  12 de Noviembre de 2017  •  Tareas  •  1.514 Palabras (7 Páginas)  •  102 Visitas

Página 1 de 7

Vectores

1. Realizar un vector de tamaño N que solicite nombres de personas, Ios

almacene y muestre.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace pares_o_impares_vector

{

    class Program

    {

        static void Main(string[] args)

        {

            int a;

            string nombre = "", b = "";

            Console.WriteLine("cuantos nombres va a poner? ");

            a = Convert.ToInt16(Console.ReadLine());

            string[] nombres = new string[a];

            for (int i = 0; i < a; i++)

            {

                Console.WriteLine("ingresa los nombres: ");

                nombre = Convert.ToString(Console.ReadLine());

                b = b + "\n" + nombre;

            }

            Console.WriteLine("los nombres digitaros fueron: " + b);

            Console.ReadKey();

        }

    }[pic 1]

}

2. Realizar un vector de tamaño 5, solicitar letras y mostrar como resultado el

siguiente formato: a-m—n-fi—x

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace vecotres

{

    class Program

    {

        static void Main(string[] args)

        {

   

            char[] letras = new char[5];

            for (int i = 0; i < 5; i++)

            {

                Console.Write("las letras son: " + i + ": " + letras[i]);

                letras[i] = Convert.ToChar(Console.ReadLine());

            }

            {

                Console.WriteLine("las letras son: "+letras[0]+"-"+letras[1]+"-"+letras[2]+"-"+letras[3]+"-"+letras[4]);

            }

            Console.ReadKey();

        }

    }

}[pic 2]

3. Crear un vector de tamaño N, solicitar calificaciones que Ilenen el vector y

mostrar el promedio general (recorriendo e| vector);

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            int edad;

            Console.WriteLine("digita tu edad");

            edad = Convert.ToInt16(Console.ReadLine());

                if (edad >= 18)

            {

                Console.WriteLine("mayor edad");

            }

            else

            {

                Console.WriteLine("menor edad");

            }

            Console.ReadKey();

        }

    }

}[pic 3]

4. Crear un vector de tamaño N, solicitar nombre y mostrar:

1. Posiciones Pares

2. Posiciones Impares

3. Orden descendente

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace vector3

{

    class Program

...

Descargar como (para miembros actualizados)  txt (4.8 Kb)   pdf (298.4 Kb)   docx (38.2 Kb)  
Leer 6 páginas más »
Disponible sólo en Clubensayos.com