I am creating a code which ask the users input for its first name, last name, hours, and wages. Then the hours and wages are then calculated and will be shown when called. Now I got this error "There is no argument given that corresponds to the required formal parameter 'input 1' of 'Human.Human(string,string)" shown on what should I change or what constructors do I need to fix?
using EncapsulationConcept;
using System;
namespace EncapsulationConcept
{
class Human
{
private string value1;
private string value2;
public Human(string input1, string input2)
{
value1 = input1;
value2 = input2;
}
public void DisplayInfo()
{
Console.WriteLine("\nfirst name is: {0}", value1);
Console.WriteLine("last name is: {0}", value2);
}
}
class Worker : Human
{
private int Hours;
private int wages = 50;
private int result;
public int HourlyWage(int hour)
{
Hours = hour;
result = hour * wages;
return hour;
}
public void DisplayInfo()
{
Console.WriteLine("\nNo. of hours in {0}", result);
}
}
}
class Program
{
static void Main(string[] args)
{
string input1, input2;
int hour;
Console.Write("First name : ");
input1 = Convert.ToString(Console.ReadLine());
Console.Write("Last name: ");
input2 = Convert.ToString(Console.ReadLine());
Console.Write("Enter hours : ");
hour = Convert.ToInt32(Console.ReadLine());
Human human = new Human(input1, input2);
human.DisplayInfo();
}
}