home *** CD-ROM | disk | FTP | other *** search
- /*+==========================================================================
- File: rothcalcr.cs
-
- Summary: Contains a class used to compute Roth IRA eligibility
-
- Classes: CRothCalculator
-
- Functions: None
-
- ----------------------------------------------------------------------------
- This file is part of the Microsoft NGWS Samples.
-
- Copyright (C) 1998-1999 Microsoft Corporation. All rights reserved.
- ==========================================================================+*/
- using System;
-
- namespace Samples.Assemblies.Download.Calcr
- {
-
- public class CRothCalculator
- {
-
- private const int StatusMarriedJoint = 0;
- private const int StatusMarriedSeparate = 1;
- private const int StatusSingle = 2;
-
- public int GetAmount(int agi, int status)
- {
- // The roth calculation is actually more complicated than this -- it phases out at various income levels
- switch (status)
- {
- case StatusMarriedJoint:
- return (agi > 160000 ? 0 : 2000);
- case StatusMarriedSeparate:
- return (agi > 110000 ? 0 : 2000);
- case StatusSingle:
- return (agi > 10000 ? 0 : 2000);
- default:
- return 0;
- }
-
- }
-
- public bool GetCanConvert(int agi, int status)
- {
- switch (status)
- {
- case StatusMarriedJoint:
- case StatusSingle:
- return (agi > 100000 ? false : true);
- case StatusMarriedSeparate:
- return false;
- default:
- return false;
- }
-
- }
-
- };
- }
-
-
-
-
-
-
-