home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / assemblies / RothIRA / RothCalcr / rothcalcr.cs < prev   
Encoding:
Text File  |  2000-06-23  |  1.5 KB  |  67 lines

  1. /*+==========================================================================
  2.   File:      rothcalcr.cs
  3.  
  4.   Summary:   Contains a class used to compute Roth IRA eligibility
  5.  
  6.   Classes:   CRothCalculator
  7.  
  8.   Functions: None
  9.              
  10. ----------------------------------------------------------------------------
  11.   This file is part of the Microsoft NGWS Samples.
  12.  
  13.   Copyright (C) 1998-1999 Microsoft Corporation.  All rights reserved.
  14. ==========================================================================+*/
  15. using System;
  16.  
  17. namespace Samples.Assemblies.Download.Calcr
  18. {
  19.  
  20.     public class CRothCalculator
  21.     {
  22.  
  23.         private const int StatusMarriedJoint = 0;
  24.         private const int StatusMarriedSeparate = 1;
  25.         private const int StatusSingle = 2;
  26.  
  27.         public int GetAmount(int agi, int status)
  28.         {
  29.             // The roth calculation is actually more complicated than this -- it phases out at various income levels
  30.             switch (status)
  31.             {
  32.             case StatusMarriedJoint:
  33.                 return (agi > 160000 ? 0 : 2000);
  34.             case StatusMarriedSeparate:
  35.                 return (agi > 110000 ? 0 : 2000);
  36.             case StatusSingle:
  37.                 return (agi > 10000 ? 0 : 2000);
  38.             default:
  39.                 return 0;
  40.             }
  41.  
  42.         }
  43.  
  44.         public bool GetCanConvert(int agi, int status)
  45.         {
  46.             switch (status)
  47.             {
  48.             case StatusMarriedJoint:
  49.             case StatusSingle:
  50.                 return (agi > 100000 ? false : true);
  51.             case StatusMarriedSeparate:
  52.                 return false;
  53.             default:
  54.                 return false;
  55.             }
  56.  
  57.         }
  58.     
  59.     };
  60. }
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.