I want to be able to create and reference a class using input from the user. I'm new to coding, so I'm not quite sure the best way to go around this. If there is a better way of doing this without classes, I am open to suggestions.
class Program
{
static void Main(string[] args)
{
Console.WriteLine("What is the name of the Salesmen?");
string userInput = Console.ReadLine();
//Create Class Instance
Salesmen[userInput] = new Salesmen();
//Access Class Methods or Variables
[userInput].Age = 35;
}
}
class Salesmen
{
public int Age;
public int Salary;
}