Jump to content

ricarditox

Novato
  • Posts

    6
  • Joined

  • Last visited

Everything posted by ricarditox

  1. resulta que quiero guardar datos en un arreglo de objeto, mostrarlos y tambien modificarlos y no se como se hace.. esto es lo que llevo hecho: using System; namespace Registro { class Datos { private int rut; private string nombre; private string fono; private string direccion; public void get(int r, string n, string f, string d) { this.rut = r; this.nombre = n; this.fono = f; this.direccion = d; } public string mostrarNombre() { return nombre; } public int nomstrarRut() { return rut; } public string mostrarFono() { return fono; } public string mostrarDireccion() { return direccion; } public void validar(int ru) { int Digito; int Contador; int Multiplo; int Acumulador; string RutDigito; Contador = 2; Acumulador = 0; while (rut != 0) { Multiplo = (rut % 10) * Contador; Acumulador = Acumulador + Multiplo; rut = rut/10; Contador = Contador + 1; if (Contador == 8) { Contador = 2; } } Digito = 11 - (Acumulador % 11); RutDigito = Digito.ToString().Trim(); if (Digito == 10 ) { RutDigito = "K"; } if (Digito == 11) { RutDigito = "0"; } Console.WriteLine("-{0}",RutDigito); } } class Program { static void Main(string[] args) { Datos obj=new Datos(); int cant,op, i, rut, resp,persona; string nombre, telefono, direccion; Console.WriteLine("Ingrese cantidad de personas : "); cant = int.Parse(Console.ReadLine()); do{ Console.WriteLine("MENU"); Console.WriteLine("1.Insertar\n2.Modificar\n3.Mostrar"); op = int.Parse(Console.ReadLine()); Datos[] arreglodeobjeto = new Datos[cant]; switch(op) { case 1: for (i = 0; i < cant; i++) { Console.WriteLine("Ingrese rut, nombre, telefono y direccion en la persona {0}: ",i+1); rut = int.Parse(Console.ReadLine()); nombre = Console.ReadLine(); telefono = Console.ReadLine(); direccion=Console.ReadLine(); arreglodeobjeto[i] = new Datos(); arreglodeobjeto[i].get(rut, nombre, telefono, direccion); } break; case 2: Console.WriteLine("Ingrese persona que desea modificar : "); persona = int.Parse(Console.ReadLine()); arreglodeobjeto[persona+1] = new Datos(); Console.WriteLine("Ingrese rut, nombre, telefono y direccion en la persona {0}: ",persona); rut = int.Parse(Console.ReadLine()); nombre = Console.ReadLine(); telefono = Console.ReadLine(); direccion = Console.ReadLine(); arreglodeobjeto[persona+1].get(rut, nombre, telefono, direccion); break; case 3: for (i = 0; i < cant; i++) { Console.Write("[{0}]", arreglodeobjeto[i]); } break; } Console.WriteLine("desea repetir operacion? 1.SI / 2.NO"); resp = Int32.Parse(Console.ReadLine()); }while(resp==1); string x = Console.ReadLine(); } } } de antemano gracias :)
  2. soy un joven dj de 19 años egresado de dj school Demo espero que les guste :)
  3. Linux Multimedia Studio Es un poco mas basico que FL Studio, solo un poco. Ademas puede abrir archivos .flp http://sourceforge.net/projects/lmms/ Esta demás decir que es gratuito. Cual es la KEY del KRISTAL AUDIO ENGINE?
  4. pongan un tutorial de como poder ejecutar los archivos :S (juegos)
  5. oie y como lo puedo instalar a una maquina virtual D:?
×
×
  • Create New...