Exemplo n.º 1
0
    public static void Main(string[] args)
    {
      // Open a bank account.
      Console.WriteLine("Create a bank account object");
      BankAccount ba = new BankAccount();
      ba.InitBankAccount();

      // Make a deposit.
      double deposit = 123.454;
      Console.WriteLine("Depositing {0:C}", deposit);
      ba.Deposit(deposit);

      // Account balance.
      Console.WriteLine("Account = {0}", ba.GetString());


      // Here's the problem.
      double addition = 0.002;
      Console.WriteLine("Adding {0:C}", addition);
      ba.Deposit(addition);

      // Resulting balance.
      Console.WriteLine("Resulting account = {0}", ba.GetString());

      // Wait for user to acknowledge the results.
      Console.WriteLine("Press Enter to terminate...");
      Console.Read();
    }