Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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 March 27th, 2011, 07:56 PM
Registered User
 
Join Date: Mar 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error ID: BC30451"INTEREST_PER_YEAR" Not declared!

I need help!
The errors I got
error: INTEREST_PER_YEAR not declared
error: PAYMENTS_PER_YEAR not declared
error: intPerPayment not declared

Here is the code in Visual Web Devoloper 2005 Express

'Create variables to hold the values entered by the user
Dim P As Double = loanAmount.Text
Dim r As Double = rate.Text / 100
Dim t As Double = mortgageLength.Text

Dim ratePerPeriod As Double
ratePerPeriod = r / INTEREST_PER_YEAR

Dim payPeriods As Integer
payPeriods = t * PAYMENTS_PER_YEAR

Dim annualRate As Double
annualRate = Math.Exp(INTERESt_CALCS_PER_YEAR * Math.Log(1 + ratePerPeriod)) - 1

Dim intPerPayment As Double
intPerPayment = (Math.Exp(Math.Log(annualRate + 1) / payPeriods) - 1) * payPeriods

'Now compute the total cost of the loan
Dim intPerMonth As Double = intPerPayment / PAYMENTS_PER_YEAR

Dim costPerMonth As Double
costPerMonth = P * intPerMonth / (1 - Math.Pow(interPerMonth + 1, -payPeriods))

Q
 
Old April 20th, 2011, 08:47 AM
Authorized User
 
Join Date: Dec 2004
Posts: 69
Thanks: 0
Thanked 5 Times in 5 Posts
Send a message via Yahoo to whiterainbow
Default

Where is the declaration of these variables? You defined P, r, t but there is no variable INTEREST_PER_YEAR, PAYMENTS_PER_YEAR (you may need to declare them as constant) in the code you posted. Can you post the full function instead?
__________________
Thanks in advance.

Regards,

Senthil Kumar M.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - pg.228 ThemeList "not declared" lsochia BOOK: Beginning ASP.NET 4 : in C# and VB 3 February 8th, 2011 03:50 AM
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
Error:"msoControlPopup is not declared" when i write an addin for Excel in VB2008 Waterharbin Visual Basic 2008 Essentials 0 September 23rd, 2010 09:10 AM
Error:"msoControlPopup is not declared" when i write an addin for Excel Waterharbin Excel VBA 0 September 23rd, 2010 09:06 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM





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