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:58 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
Code:
        '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))
 
Old March 28th, 2011, 03:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The problem is exactly what the error message says: INTEREST_PER_YEAR is not declared.

You're using this constant / variable, without declaring. What makes you think it can be used? Did you define it elsewhere?

You could declare it in your code as follows:

Dim INTEREST_PER_YEAR As Double = 4

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error ID: BC30451"INTEREST_PER_YEAR" Not declared! asksev1 Visual Studio 2005 1 April 20th, 2011 08:47 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.