O'Reilly logo

Application Development Using Visual Basic® and .NET by Dana L. Wyatt, Peter Thorsteinson, Robert J. Oberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Performing Calculations in VB.NET

Our “Hello, world” program illustrated the basic structure of a VB.NET program, but we will need a slightly more elaborate example to show the use of other basic programming constructs, such as variables, expressions, and control structures. The example illustrates a number of features, which we will explain later. Our next example is a simple calculator for an IRA account. We calculate the accumulation of deposits to an IRA of $2000.00 a year at 6% interest for 10 years, assuming that each deposit is made at the end of the year. Our calculation is performed in two ways:

  • In a loop, year by year, accumulating a total as we go.

  • Using a formula.

The example program is in the folder Ira\Step1.

 ' Ira.vb - Step 1 Imports ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required