static void Main(string[] args) { var Checking = new Accounts { Id = 0003214, Type = "Checking", Amount = 100.00m, IsOpen = true }; var Savings = new Accounts { Id = 0003211, Type = "Savings", Amount = 0.00m, IsOpen = true }; Customer alice = new Customer { Checking = Checking, Savings = Savings }; alice.Checking.Transfer(alice.Savings, 30m); Console.WriteLine(alice.Checking.Amount); Console.WriteLine(alice.Savings.Amount); Console.ReadLine(); }
static void Main(string[] args) { var Alice = new Customer(); //Setup Checking ACCT object data-member Alice.Checking.Id = "0001"; Alice.Checking.Type = "Checking"; Alice.Checking.Amount = 100; Alice.Checking.IsOpen = true; Alice.Savings.Id = "0002"; Alice.Savings.Type = "Savings"; Alice.Savings.Amount = 0; Alice.Savings.IsOpen = false; //pause Console.ReadLine(); }
static void Main(string[] args) { Customer cust1 = new Customer { BillingAddress = { City = "Houston", Street = "3232 Detering", ZIP = "77007" }, ShippingAddress = { City = "Denver", Street = "1584 Elway", ZIP = "88550" }, FirstName = "Cade", LastName = "Winter" }; }
static void Main(string[] args) { Customer alice = new Customer { FirstName = "Alice", MiddleInitial = "N", LastName = "Wonderland", BillingAddress = new Address { Street = "210 Jackson Street", City = "Houston", ZIP = "70512" }, CheckingAccount = new Account { IdNum = 789321456, Type = AccountType.Checking, Balance = 100m, IsOpen = true }, SavingsAccount = new Account { IdNum = 789321654, Type = AccountType.Savings, Balance = 0m, IsOpen = false } }; Console.WriteLine(string.Format("{0} {1} {2}", alice.FirstName, alice.MiddleInitial, alice.LastName)); Customer.Transfer(alice.CheckingAccount, alice.SavingsAccount, 23.45m); Console.WriteLine(string.Format("{0} has {1} in checking and {2} in savings.", alice.FirstName, alice.CheckingAccount.Balance, alice.SavingsAccount.Balance)); //pause Console.ReadLine(); }
static void Main(string[] args) { var customer1 = new Customer { Name = "Alice", CheckingAccount = { Id = 98235, Type = "Checking", Amount = 100.00m, IsOpen = true }, SavingsAccount = { Id = 23468, Type = "Savings", Amount = 0.00m, IsOpen = false } }; customer1.Transfer(50.00m); }
static void Main(string[] args) { Customer cust1 = new Customer { FirstName = "Alice", Checking = { Id = "My checking", Amount = 100.00m, IsOpen = true, Type = AccountType.Checking }, Savings = { Amount = 0.00m, Id = "My Savings", IsOpen = false, Type = AccountType.Savings } }; cust1.Transfer(50m, AccountType.Checking, AccountType.Savings); Console.WriteLine(cust1.Checking.Amount); Console.WriteLine(cust1.Savings.Amount); Console.ReadLine(); }
static void Main(string[] args) { var customer = new Customer { //sets name Name = "Alice", //sets checking account Checking = { Id=1234, Amount=100.00m, Type="Checking", IsOpen = true }, //sets Savings account Savings = { Id=4321, Amount=0m, Type="Savings", IsOpen = false } }; Console.WriteLine(customer.Name + " has {0:C} in account {1} ", customer.Checking.Amount, customer.Checking.Type); Console.ReadLine(); }