I'm trying to figure out why I'm getting this error, I'm not sure what I should do, I've tried to delete parameters and then it works, but I need it to work with parameters. The class "Manager" that inherits from "Employee" gives an error.
using System;
class MainClass
{
class Employee
{
public string name;
public string jobTitle;
public double salary;
public Employee(string empName, string empJobTitle, double empSalary)
{
}
public double calculateYearlySalary(double salary)
{
double yearlySalary = salary * 12;
return yearlySalary;
}
}
class Manager : Employee
{
public int bonus;
public Manager(string empName, string empJobTitle, double empSalary, int empBonus)
{
}
}
public static void Main()
{
Employee emp1 = new Employee("John", "Junior Software Engineer", 32.45);
Manager emp2 = new Manager("David", "Senior Software Engineer", 62.20, 10);
Console.WriteLine(emp1.calculateYearlySalary(100.00));
}
}
The error exactly:
"/Users/Oliver/Projects/printstars/printstars/Program.cs(16,16): Error CS7036: There is no argument given that corresponds to the required formal parameter 'empName' of 'MainClass.Employee.Employee(string, string, double)' (CS7036) (printstars)"