So I am making an employee abstract class for a company.
public abstract class Employee
{
private string name;
private int age;
private string title;
private double salary;
public string Name { get; set; }
public int Age { get; set; }
public string Title { get; set; }
public double Salary { get; set; }
}
With each different type of employee class
class Owner : Employee
{
public Owner(Employee name)
{
this.Name = Name;
}
}
class Accountant: Employee
{
public Accountant(Employee name)
{
this.Name = Name;
}
}
}
etc. on class types for different type of employees.
How (if I even setup the classes right) would I then input names, ages, titles, etc. for the different types. I know I don't have all the methods called in the classes.. but I was trying to just start with setting/getting names.
class Program
{
static void Main(string[] args)
{
Owner Oname = new Owner(name: Oname = "Tom");
Accountant Aname = new Accountant(name: Aname ="Tim");
Console.WriteLine("Owner name: " + Oname.Name);
Console.WriteLine("Account name: " + Aname.Name);
}
}