Esempio n. 1
0
        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 fractionalAddition = 0.002;

            Console.WriteLine("Adding {0:C}", fractionalAddition);
            ba.Deposit(fractionalAddition);

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

            // Wait for user to acknowledge the results.
            Console.WriteLine("Press Enter to terminate...");
            Console.Read();
        }
Esempio n. 2
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();
    }
Esempio n. 3
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 dDeposit = 123.454;

            Console.WriteLine("Depositing {0:C}", dDeposit);
            ba.Deposit(dDeposit);

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


            // here's the problem
            double dAddition = 0.002;

            Console.WriteLine("Adding {0:C}", dAddition);
            ba.Deposit(dAddition);

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

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