Jump to content

morr666

Novato
  • Posts

    3
  • Joined

  • Last visited

Información Personal

  • Pais
    Chile
  • Genero
    Hombre

morr666's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Si pensaba eso... pero mira la clase doctor hereda de persona... aunque igual probé pasando solo 3 datos como dice la clase doctor, ademas le saco la herencia y me toma altiro.
  2. La foto no es problema de ello... es solo de código algo falta no se....
  3. Bueno amigos tengo un problemin les cuento... Estoy trabajando con monodevelop y trato de hacer un pequeño programa en consola, pero al momento de crear el objeto y pasar parametros al constructor, me da el error: Error CS1729: The type `Consultamedica3raclase.Doctor' does not contain a constructor that takes `10' arguments (CS1729) Datos: Llamo al constructor de la clase Doctor desde el Main, Tengo una Super Clase Persona de la cual todas las otras clases heredan. MAIN using System; namespace Consultamedica3raclase { class MainClass { public static void Main (string[] args) { Doctor A = new Doctor ("morr","asdf","Julio","Hernandez",999999999,"Covadonga 161",232323,"Medicina",1,"str@adsds"); //Persona B = new Persona ("morr","asdf","Julio","Hernandez",162423800,"Covadonga 161",232323); //Doctor A = new Doctor ("M",1,"asdad@asdasd"); //Console.WriteLine ("El Apellido del doctor es:"); Console.WriteLine (A.getJornada()); //System.Console.Out.System.IO.TextWriter(A.Nombre); } } } PERSONA using System; namespace Consultamedica3raclase { public class Persona { public string Login; public string Password; public string Nombre; public string Apellido; public int Run; public string Direccion; public int Telefono; public Persona (string xLogin , string xPassword , string xNombre , string xApellido ,int xRun, string xDireccion, int xTelefono){ this.Login=xLogin; this.Password=xPassword; this.Nombre=xNombre; this.Apellido=xApellido; this.Run=xRun; this.Direccion=xDireccion; this.Telefono=xTelefono; } public string getLogin(){ return this.Login; } public string getPassword(){ return this.Password; } public string getNombre(){ return this.Nombre; } public string getApellido(){ return this.Apellido; } public int getRun(){ return this.Run; } public string getDireccion(){ return this.Direccion; } public int getTelefono(){ return this.Telefono; } } } PACIENTE using System; namespace Consultamedica3raclase { public class Persona { public string Login; public string Password; public string Nombre; public string Apellido; public int Run; public string Direccion; public int Telefono; public Persona (string xLogin , string xPassword , string xNombre , string xApellido ,int xRun, string xDireccion, int xTelefono){ this.Login=xLogin; this.Password=xPassword; this.Nombre=xNombre; this.Apellido=xApellido; this.Run=xRun; this.Direccion=xDireccion; this.Telefono=xTelefono; } public string getLogin(){ return this.Login; } public string getPassword(){ return this.Password; } public string getNombre(){ return this.Nombre; } public string getApellido(){ return this.Apellido; } public int getRun(){ return this.Run; } public string getDireccion(){ return this.Direccion; } public int getTelefono(){ return this.Telefono; } } } DOCTOR using System; namespace Consultamedica3raclase { public class Doctor : Persona { public string Especialidad; public int Jornada; public string Correo; public Doctor (string xEspecialidad,int xJornada,string xCorreo){ this.Especialidad=xEspecialidad; this.Jornada=xJornada; this.Correo=xCorreo; } public string getxEspecilidad(){ return this.Especialidad; } public int getJornada(){ return this.Jornada; } public string getCorreo(){ return this.Correo; } } } ADMINISTRADOR using System; namespace Consultamedica3raclase { public class Administrador : Persona{ public int Privilegios; public string Correo; public Administrador (int xPrivilegios , string xCorreo){ this.Privilegios=xPrivilegios; this.Correo=xCorreo; } public int getPrivilegios(){ return this.Privilegios; } public string getCorreo(){ return this.Correo; } } } SECRETARIA using System; namespace Consultamedica3raclase { public class Secretaria : Persona{ public string Correo; public Secretaria (string xCorreo){ this.Correo=xCorreo; } public string getCorreo(){ return this.Correo; } } } NOTA: al cerrar el programa monodevelop me dice algo de exeption no se si estará relacionado con el problema publico foto abajo Gracias
×
×
  • Create New...