Example #1
0
 public bool payWithSavings(VenmoUser payer, VenmoUser payee, decimal amount)
 {
     //bool success = false;
     if (payer.savings.withdrawal(amount))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #2
0
 public bool acceptPayment(VenmoUser payee, decimal amount, Object account)
 {
     if (account is "Checking Account")
     {
         payee.checking.deposit(amount);
     }
     if (account is "Savings Account")
     {
         payee.savings.deposit(amount);
     }
     else
     {
         return(false);
     }
     return(true);
 }
Example #3
0
        private void VenmoApp_Load(object sender, EventArgs e)
        {
            VenmoUser junior = new VenmoUser("Junior", "DoSantos", "*****@*****.**");

            junior.AddPaymentMethod(new SavingsAccount());
            junior.AddPaymentMethod(new CheckingAccount());
            users[0] = junior;

            VenmoUser pain = new VenmoUser("Pain", "DeVito", "*****@*****.**");

            pain.AddPaymentMethod(new SavingsAccount());
            pain.AddPaymentMethod(new CheckingAccount());
            users[1] = pain;

            VenmoUser crusher = new VenmoUser("Crusher", "McPawnface", "*****@*****.**");

            crusher.AddPaymentMethod(new SavingsAccount());
            crusher.AddPaymentMethod(new CheckingAccount());
            users[2] = crusher;

            VenmoUser rusty = new VenmoUser("Rusty", "Barnes", "*****@*****.**");

            rusty.AddPaymentMethod(new SavingsAccount());
            rusty.AddPaymentMethod(new CheckingAccount());
            users[3] = rusty;

            VenmoUser adam = new VenmoUser("Adam", "Palehorse", "*****@*****.**");

            adam.AddPaymentMethod(new SavingsAccount());
            adam.AddPaymentMethod(new CheckingAccount());
            users[4] = adam;

            VenmoUser seggsy = new VenmoUser("Seggsy", "Davis", "*****@*****.**");

            seggsy.AddPaymentMethod(new SavingsAccount());
            seggsy.AddPaymentMethod(new CheckingAccount());
            users[5] = seggsy;

            updateLabel();
        }