I have the following slogan: Make a programmer view (name, surname, hours worked, button calculate ()) The method calculate returns the result in a programmer view 2 (name, surname - read only). (Time value and incentive in the class as private attribute - to calculate salary: Hour value * Working hours + incentive). I have to make an inheritance between Employee and EmployeeProgrammer.
empleado.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Empresa.Models
{
public abstract class Empleado
{
protected string Nombre { set; get; }
protected string Apellido { set; get; }
public Empleado() { }
public Empleado(string Nombre, string Apellido)
{
Nombre = this.Nombre;
Apellido = this.Apellido;
}
/* public abstract float CalcularSueldo();
} */
}
}
EmployeeProgrammer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Empresa.Models
{
public class EmpleadoProgramador : Empleado
{
private float SueldoFijo { set; get; }
// public EmpleadoProgramador() { }
private void EmpleadoProgramador(string Nombre, string Apellido, int horas,float valorHora, float incentivo) : base(Nombre, Apellido)
{
horas = 30;
valorHora = 50;
incentivo = 5000;
CalcularSueldo(Nombre, Apellido, horas, valorHora, incentivo);
}
public float CalcularSueldo(horas, valorHora, incentivo)
{
float SueldoFijo = valorHora * horas + incentivo;
return SueldoFijo;
}
}
}
In private void EmpleadoProgramador(string Nombre, string Apellido, int horas,float valorHora, float incentivo) : base(Nombre, Apellido)
it tells me that "the names of the members can not match the enveloping types" and he does not accept me: for the inheritance, he does not accept the CalculateSueldo () method because he says that there is no overload.
Also in
public float CalcularSueldo(horas, valorHora, incentivo)
{
float SueldoFijo = valorHora * horas + incentivo;
return SueldoFijo;
}
He tells me that there are no such types. What am I doing wrong?