CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Help in VB.Net

  1. #1
    Join Date
    Jan 2007
    Posts
    2

    Question Look at my code and tell me what i'm doing wrong?

    Creating a calculator that computes compounded interest at the end of a set number of years. The balance grows each year according to this formula. new balance = prevoius balance*(1+interest rate)
    Create a web application which accepts an initial balance, an annual interest rate, and number of years and displays the compounded account balance at the end of the stated period.

    Specs
    Include two buttons - one to perform the calculation and one to clear the inputs.

    Create a class called FutureValue which contains the following:

    three data members to match the form inputs
    three property assessors to get and set the data members
    a function to calculate and return the future value. Use a loop (of your choice) to perform the calculation.
    When the Calculate button is clicked, do the following:

    create an object of type FutureValue
    use the set assessors to store the values from your form in the object
    call the function to calculate the future value and display it on the form. You may display the value in a label or in a read-only text box.
    When the Clear button is clicked, clear all the input boxes.


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>


    <body>
    <form name="form1" method="post" action="default.aspx" id="form1">
    <div>
    <input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTcwMzcwNDkwOQ9kFgICAw9kFgoCCQ8QZBAVBgEzATQBNQE2ATcBOBUGATMBNAE1ATYBNwE4FCsDBmdnZ2dnZ2RkAg0PEGQQFRQBMQEyATMBNAE1ATYBNwE4ATkCMTACMTECMTICMTMCMTQCMTUCMTYCMTcCMTgCMTkCMjAVFAExATIBMwE0ATUBNgE3ATgBOQIxMAIxMQIxMgIxMwIxNAIxNQIxNgIxNwIxOAIxOQIyMBQrAxRnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2RkAg8PEA8WAh4HQ2hlY2tlZGdkZGRkAhUPDxYIHgdWaXNpYmxlaB4EVGV4dAUwWW91ciBlbmRpbmcgYmFsYW5jZSBhZnRlciAyMCB5ZWFycyA9ICQzNDgsMjcxLjYwHglGb3JlQ29sb3IKIx4EXyFTQgIEZGQCFw8PFgIfAWhkZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQULY2hrYkRldGFpbHNpY57eQCgo4ATYuqp7TIprTzntig==" />
    </div>

    <script type="text/javascript">
    <!--
    var theForm = document.forms['form1'];
    if (!theForm) {
    theForm = document.form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
    }
    }
    // -->
    </script>

    <p align="center">Future Value</p>
    <p align="left">Initial Balance
    <label>
    <input name="textfield" type="text" value="$" />
    </label>
    </p>
    <p align="left">Annual Interest Rate
    <label>
    <input name="textfield2" type="text" maxlength="2" />
    </label>
    </p>
    <p align="left">Number of Years
    <label>
    <input name="textfield3" type="text" maxlength="2" />
    </label>
    </p>
    <p>
    <label>
    <input type="submit" name="Submit" value="Submit" />
    </label>
    </p>
    <p>
    <label>
    <input type="reset" name="Submit2" value="Reset" />
    </label>
    </p>
    </body>
    </html>
    Last edited by g_thugga; January 31st, 2007 at 11:04 PM.

  2. #2
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: Help??????

    So you've posted your homework assignment. Do you expect us to do the work for you? If you have specific questions then by all means ask them and we'll answer appropriately. We're here to help, not do the work for you. If you have no idea whatsoever then maybe programming isn't for you. If you have an idea how to proceed then let us know your thoughts, what you've done so far and what you're stuck on. Otherwise we'll just assume that you're lazy. By all means prove that assumption incorrect.
    Tutorials: Home & Learn | Start VB.NET | Learn VB.NET | C# Station | GotDotNet | Games in VB.NET 101 Samples: 2002 | 2003 | 2005 | More .NET 2.0 (VB.NET, C#) Articles: VB.NET | C# | ASP.NET | MoreFree Components: WFC | XPCC | ElementsEx | VBPP | Mentalis | ADO.NET/MySQL | VisualStyles | Charting (NPlot, ZedGraph) | iTextSharp (PDF) | SDF (CF) ● Free Literature: VB 2005 (eBook) | VB6 to VB.NET (eBook) | MSDN Magazine (CHM format) ● Bookmarks: MSDN | WinForms .NET | ASP.NET | WinForms FAQ | WebForms FAQ | GotDotNet | Code Project | DevBuzz (CF) ● Code Converter: C#/VB.NET | VB.NET/C# | VS 2005 add-in

  3. #3
    Join Date
    Jan 2007
    Posts
    2

    Re: Help??????

    I have included my code so if you look at it maybe u can help me and tell me what i'm doing wrong.

  4. #4
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: Help??????

    Do you take your car to the machanic and expect it to be fixed without desribing the problem? Do you go to the doctor and expect a diagnosis without describing your symptoms? If you're having an issue then describe it so we have an idea what we're looking for.
    Tutorials: Home & Learn | Start VB.NET | Learn VB.NET | C# Station | GotDotNet | Games in VB.NET 101 Samples: 2002 | 2003 | 2005 | More .NET 2.0 (VB.NET, C#) Articles: VB.NET | C# | ASP.NET | MoreFree Components: WFC | XPCC | ElementsEx | VBPP | Mentalis | ADO.NET/MySQL | VisualStyles | Charting (NPlot, ZedGraph) | iTextSharp (PDF) | SDF (CF) ● Free Literature: VB 2005 (eBook) | VB6 to VB.NET (eBook) | MSDN Magazine (CHM format) ● Bookmarks: MSDN | WinForms .NET | ASP.NET | WinForms FAQ | WebForms FAQ | GotDotNet | Code Project | DevBuzz (CF) ● Code Converter: C#/VB.NET | VB.NET/C# | VS 2005 add-in

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured