title: Taking user input as name of new class instance
body: <p>I am trying to create a class in C# called customer, with 3 variables: name, initial deposit, and monthly deposit amount.</p>
  
  <p>This is for a console program that takes user input for those three variables and keeps asking for more users until the user types nothing and presses enter.</p>
  
  <p>However, the line 
  <code>customer userInputName = new customer(userInputName, userInputInitial, userInputMonthly);</code> 
  is giving me errors. The first userInputName is underlined saying <em>"a local or parameter named 'userInputName' cannot be delcared in this scope because that name is used in an enclosing local scope to define a local or parameter"</em>. The second 'userInputName' says <em>"Argument 1: cannot convert from 'lab4.Program.customer' to 'string' "</em>. </p>
  
  <p>The only way I can fix this is by changing the first 'userInputName' to something like customer1, but if I do that, I can't continuously make new customers if the user continues typing names.</p>
  
  <p>Ideally, I want to be able to type something like customer.Bob.initialDeposit and have the program able to tell me what Bob's initial Deposit was, etc.</p>
  
  <p>How can I achieve this, or what am I doing wrong?</p>
  
  <pre><code>using System;
  
  namespace lab4
  {
      class Program
      {
          static void Main(string[] args)
          {
              Console.WriteLine("How many months will the customer keep the money in the account?");
              string monthsString = Console.ReadLine();
              int months = Int32.Parse(monthsString);
  
              bool run = true;
              while (run)
              {
                  Console.WriteLine("Enter new customer name: ");
  
                  string userInputName = Console.ReadLine();
                  if (userInputName == "")
                  {
                      run = false;
                  }
                  else
                  {
                      Console.WriteLine("Enter initial deposit amount: ");
                      string stringInitDeposit = Console.ReadLine();
                      int userInputInitial = Int32.Parse(stringInitDeposit);
  
                      Console.WriteLine("Enter montly deposit amount: ");
                      string stringMonthDeposit = Console.ReadLine();
                      int userInputMonthly = Int32.Parse(stringMonthDeposit);
  
                      customer userInputName = new customer(userInputName, userInputInitial, userInputMonthly);
                  }
  
              }
          }
  
  
              public class customer
              {
                  public string name;
                  public int initialDeposit;
                  public int monthlyDeposit;
  
                  public customer(string name, int initialDeposit, int monthlyDeposit)
                  {
                      this.name = name;
                      this.initialDeposit = initialDeposit;
                      this.monthlyDeposit = monthlyDeposit;
                  }
              }
      }
  }
  </code></pre>