title: Creating object with a name given by user input
body: <p>I'm currently learning c#, and i'm trying to make a script that create a bank account and then find it back and add money on it.</p>
  
  <p>This method is used to create a new account :</p>
  
  <pre><code>static void CreateNewAccount()
      {
          Console.WriteLine("Enter a name for a new account.");
          string bname = Console.ReadLine();
          Console.WriteLine("Creating a new account for : {0}", bname);
          List&lt;BankAccount&gt; account = new List&lt;BankAccount&gt;() // not sure about it
          {
              new BankAccount { name = bname } // creating a new account
      };
  
          Console.WriteLine(account.Exists(x =&gt; x.name == bname));
          var useraccount = account.Find(x =&gt; x.name == bname); // Trying to find the account that i've created earlier
          useraccount.Deposit(100); // trying to add money on it
          useraccount.CheckBalance();
          Console.WriteLine("test");
  
      }
  </code></pre>
  
  <p>And here is my class :</p>
  
  <pre><code>class BankAccount
  {
      private double _balance=0;
      public string name;
      public BankAccount()
      {
          Console.WriteLine("You succesfuly created a new account.");
      }
      public double CheckBalance()
      {
          return _balance;
      }
      public void Deposit(double n)
      {
          _balance += n;
      }
      public void WithDraw(double n)
      {
          _balance -= n;
      }
  }
  </code></pre>
  
  <p>I'm not sure at all about how to use List and how to use Find. I writed this because i've it found on a similar script.</p>
  
  <p>Do you know a easy way to make it ? I'm a beginner.</p>
  
  <p>Thanks</p>