// Fig. C.02: AccountTest.cs
// Create and manipulate an Account object.
using System;

public class AccountTest
{
   // Main method begins execution of C# application
   public static void Main(string[] args)
   {
      Account account1 = new Account(50.00M); // create Account object

      // display initial balance of each object using property Balance
      Console.Write("account1 balance: {0:C}\n",
         account1.Balance); // display Balance 

      decimal depositAmount; // deposit amount read from user

      // prompt and obtain user input
      Console.Write( "Enter deposit amount for account1: ");
      depositAmount = Convert.ToDecimal(Console.ReadLine() );
      Console.Write("adding {0:C} to account1 balance\n\n",
         depositAmount);
      account1.Credit(depositAmount); // add to account1 balance

      // display balance
      Console.Write("account1 balance: {0:C}\n",
         account1.Balance);
      Console.WriteLine();
   } // end Main
} // end class AccountTest


/**************************************************************************
 * (C) Copyright 1992-2006 by Deitel & Associates, Inc. and               *
 * Pearson Education, Inc. All Rights Reserved.                           *
 *                                                                        *
 * DISCLAIMER: The authors and publisher of this book have used their     *
 * best efforts in preparing the book. These efforts include the          *
 * development, research, and testing of the theories and programs        *
 * to determine their effectiveness. The authors and publisher make       *
 * no warranty of any kind, expressed or implied, with regard to these    *
 * programs or to the documentation contained in these books. The authors *
 * and publisher shall not be liable in any event for incidental or       *
 * consequential damages in connection with, or arising out of, the       *
 * furnishing, performance, or use of these programs.                     *
 *************************************************************************/