Current location: Hot Scripts Forums » Programming Languages » ASP » Create investment calculator in asp.net


Create investment calculator in asp.net

Reply
  #1 (permalink)  
Old 09-30-04, 11:36 PM
Activexcode Activexcode is offline
New Member
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Create investment calculator in asp.net

I'm trying to create and then post, a simple, working investment calculator to the web. I use Microsoft Visual Studio. As a novice, I am having a little problem with executing this code.

Please help. I need an answer by Noon October 1 (EST).

Thanks so much for your expertise! Here's the code so far. Please help with syntax:
__________________________________________________ _______________
<html>
<head>
<title>Investment Calculator</title>
</head>
<body>

<%
DIM initialinvestment, annualrateofreturn, numberofyears

initialinvestment = request.form ("initialinvestment")
response.write ("Initial investment is:" & initialinvestment & "<br/>")

annualrateofreturn = request.form ("annualrateofreturn")
response.write ("Annual rate of return is:" & annualrateofreturn & "<br/>")

numberofyears = request.form ("numberofyears")
response.write ("Number of years:" & numberofyears & "<br/>")

for counter = 1 to n
initialinvestment = initialinvestment
annualrateofreturn = annualrateofreturn
numberofyears = counter

next
%>
<form method = "post" action= "Investment Calculator.asp">

<h4>Initial Investment:</h4>
<input type= "text" name= "initial investment" value=<%= initialinvestment%>/><br/>

<h4>Expected Annual Rate of Return(%):</h4>
<input type="text" name="annual rate of return" size = "10" maxlength = "10" value=<%= annualrateofreturn%>'/><br/>

<h4>Number of Years:</h4>
<input type="text" name="number of years" size = "3" maxlength = "3" value=<% = numberofyears%>/><br/>

<p><input type="submit" name ="Calculate the Future Value" value="submit"/></p>
<input type= "reset" name="Reset" value = "Reset">


</form>
</body>
</html>
__________________________________________________ _______________

Notes:

1) The interest is compounded annually.

2) The form should stay filled in so that the user can make changes to the previous input and resubmit.

3) I need a running results table (two columns) underneath the form. This table will display the year in (col1) and the value of the investment at the end of the year (col2).

Please post answer to this forum or to my email activexcode@hotmail.com.

Once again, thanks! :-)
Reply With Quote
  #2 (permalink)  
Old 10-01-04, 04:33 PM
Naresh Rohra Naresh Rohra is offline
Newbie Coder
 
Join Date: Jun 2004
Location: India
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Reply

Quote:
for counter = 1 to n
initialinvestment = initialinvestment
annualrateofreturn = annualrateofreturn
numberofyears = counter

next
What is n. Instead of numberofyears


Use this correction:

Code:
<TR>
<TABLE>
<TH> YEAR 
<TH> RETURN VALUE AFTER YEAR 
</TR>

<%

Dim intYear
intYear= 0
 
for intYear = 1 to numberofyears

      initialinvestment = initialinvestment * ( 1 + rateofinterest/100)   '*** If rate of interest is expressed in %, say 75%, else remove /100
      Response.write("<TR> <TD> " & <%= intYear %> "<TD> " & <%= initialinvestment %>" & <"/TR>")

next 

</TABLE>
Cheers.
Naresh.
__________________
My Home Page

Last edited by Naresh Rohra; 10-01-04 at 04:35 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help for creating dynamic checkbox in asp.net l3nny ASP.NET 1 07-01-04 06:45 AM
VB or C# a must to work asp.net?? donkon ASP 0 04-02-04 04:32 PM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM
Simple investment calculator ? jakob Job Offers & Assistance 1 11-16-03 12:32 PM


All times are GMT -5. The time now is 03:05 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.