Wrox Programmer Forums
|
BOOK: MCSD Certification Toolkit (Exam 70-483): Programming in C#
This is the forum to discuss the Wrox book MCSD Certification Toolkit (Exam 70-483): Programming in C# by Tiberiu Covaci, Rod Stephens, Vincent Varallo, Gerry O'Brien; ISBN: 978-1-118-61209-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: MCSD Certification Toolkit (Exam 70-483): Programming in C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 24th, 2014, 02:26 PM
Registered User
 
Join Date: May 2014
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6 Page 229

In the Debit method, since you are check the amount against both overdraft + savings account balance, you most like want to send the combined balance in the OverdrawnEventArgs. So, I think this

OnOverdrawn(new OverdrawnEventArgs(Balance, amount));

should be

OnOverdrawn(new OverdrawnEventArgs(Balance + SavingsAccount.Balance, amount));
 
Old May 24th, 2014, 03:36 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

That could very well be. I actually don't know what the rules are for an overdraft account so I just sort of made it up.

It might be even more useful to pass the account objects as OverdrawnEventArgs properties so the main program could examine the two accounts and figure out what to do about them. That gives the main program the greatest flexibility because it can determine any of the balances it needs to know.

(Aside: In real life, I've heard some nasty stories about banks doing things like ordering monthly debits in decreasing order. For example, suppose you have $100 in your account and you write checks for $100, $50, $20, and $15. If you try to pay them in that order, the first one cleans out the account so you get hit with 3 overdrawn charges. If you pay them in the order $15, $20, $50, $100, then you can pay the first three and only one is overdrawn. I think the ordering-to-maximize-charges strategy is now illegal.)
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8 Ajax.ActionLink, at page 197. PartialView displayed as its own page. JimiFriis BOOK: Professional ASP.NET MVC 4 1 March 25th, 2015 04:18 AM
Chapter 8 - Page 232, Step 5 Building the Master Page bisigreat BOOK: Professional SharePoint 2010 Branding and User Interface Design 0 May 8th, 2013 12:58 PM
Chapter 3 - Page 69 sirab33 BOOK: Beginning iOS 4 Application Development 7 September 7th, 2011 08:54 PM
chapter 2 - page 41 problem creating the page.. jorjiana BOOK: Beginning Oracle Application Express ISBN: 9780470388372 2 August 22nd, 2009 04:25 AM
Typos on page 229 est BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 0 April 14th, 2006 05:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.