Advertisement

07.10.2008 at 07:59AM PDT, ID: 23554005
[x]
Attachment Details

Asp.Net Calculator Application

Asked by theclassic in .Net Editors & IDEs, Visual Basic Programming, Programming for ASP.NET

Tags: asp.net, All

I have a calculator I am updating and there seems to be an issue with one of the outputs.

The link to the calculator is here  
http://www.x.com/nea/calculators/contribution/2007/defaultincorrectlimits.aspx

If you enter in information and press calculate, it offers a number of different read outs, and allows you to change scenarios.  On the last table on the results page, "Contributing Enough to get the full employer match", the percentage for "Contribution Percentage to Maximize your match" is spitting out the wrong number, and appending a negative sign to it.  I have traced back the financial equations, and I think the problem lies with in this piece of code here :

function CalculateRemainingPayPeriods() as integer
            dim todaysDate as datetime
            
            if not request.querystring("SimulatedDate") is nothing then
                  if isDate(request.querystring("SimulatedDate")) then
                        todaysDate = request.querystring("SimulatedDate")
                  else if now < CDate("1/7/2008") then
                        todaysDate = CDate("1/7/2008")
                  else
                        todaysDate = now
                  end if
            else if now < CDate("1/7/2008") then
                  todaysDate = CDate("1/7/2008")
            else
                  todaysDate = now
            end if
            
            dim todaysYear as integer = todaysDate.year()
            dim intPayPeriodsRemaining as integer = 0
            dim dateStartPayPeriod as datetime = "1/7/2008"

            do while dateStartPayPeriod <= todaysDate
                  dateStartPayPeriod = dateStartPayPeriod.addDays(14)
            loop                        
            
            do while dateStartPayPeriod.year() < todaysYear + 1
                  dateStartPayPeriod = dateStartPayPeriod.AddDays(14)
                  intPayPeriodsRemaining += 1
            loop
            return intPayPeriodsRemaining
      end function

So basically I am a little lost - "Simulated Date" is not found anywhere in the code except for here - and I am not sure what this piece of code is doing, but the function is written to determine the amount of pay periods left in the year each time the visitor visits the page, but I think that it is written on - Anyone point me in the right direction, It would be very much appreciatedStart Free Trial
1:
2:
3:
URL Masked by Asker Request
http://www.experts-exchange.com/Q_23589618.html
WhackAMod - 7/23/08
[+][-]07.10.2008 at 10:04AM PDT, ID: 21975481

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 10:06AM PDT, ID: 21975498

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 10:37AM PDT, ID: 21975766

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Visual Basic Programming, Programming for ASP.NET
Tags: asp.net, All
Sign Up Now!
Solution Provided By: theclassic
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.17.2008 at 09:56AM PDT, ID: 22027430

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628