DEBUGGING AND EXECUTING A NEW PROJECT in Visual Studio .NET

Draw QR Code ISO/IEC18004 in Visual Studio .NET DEBUGGING AND EXECUTING A NEW PROJECT

DEBUGGING AND EXECUTING A NEW PROJECT
Reading QR Code In .NET Framework
Using Barcode Control SDK for .NET framework Control to generate, create, read, scan barcode image in VS .NET applications.
Draw QR-Code In Visual Studio .NET
Using Barcode generator for Visual Studio .NET Control to generate, create QR Code image in Visual Studio .NET applications.
where f = (1 + r ) n A Visual Basic program has been written to carry out this calculation. The program accepts the values of P, n and i within separate text boxes, and then displays the calculated value of A within another text box. The Form Design Window is shown in Fig. 6.13.
Scanning QR In .NET
Using Barcode reader for VS .NET Control to read, scan read, scan image in VS .NET applications.
Barcode Generator In .NET
Using Barcode creation for Visual Studio .NET Control to generate, create barcode image in VS .NET applications.
The corresponding Visual Basic code is shown in the Code Editor Window in Fig. 6.14.
Barcode Scanner In Visual Studio .NET
Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
Make QR Code In C#.NET
Using Barcode generation for .NET Control to generate, create QR Code 2d barcode image in .NET framework applications.
Fig. 6.13 The Form Design Window
QR Code Drawer In Visual Studio .NET
Using Barcode drawer for ASP.NET Control to generate, create Denso QR Bar Code image in ASP.NET applications.
Creating QR Code 2d Barcode In VB.NET
Using Barcode printer for Visual Studio .NET Control to generate, create QR Code image in VS .NET applications.
Fig. 6.14 The Code Editor Window
Creating USS Code 39 In .NET
Using Barcode creator for Visual Studio .NET Control to generate, create Code39 image in Visual Studio .NET applications.
Encode Code 128 Code Set B In VS .NET
Using Barcode creator for .NET framework Control to generate, create Code 128 Code Set C image in Visual Studio .NET applications.
AM FL Y
Drawing Barcode In .NET Framework
Using Barcode printer for .NET Control to generate, create barcode image in VS .NET applications.
Code-27 Maker In .NET Framework
Using Barcode encoder for .NET Control to generate, create ABC Codabar image in VS .NET applications.
Team-Fly
Printing GTIN - 128 In None
Using Barcode generator for Font Control to generate, create EAN 128 image in Font applications.
UCC - 12 Scanner In Visual Basic .NET
Using Barcode decoder for VS .NET Control to read, scan read, scan image in VS .NET applications.
DEBUGGING AND EXECUTING A NEW PROJECT
GS1-128 Maker In None
Using Barcode maker for Microsoft Excel Control to generate, create UCC.EAN - 128 image in Office Excel applications.
GS1 DataBar Truncated Creator In Java
Using Barcode creation for Java Control to generate, create GS1 DataBar image in Java applications.
[CHAP. 6
Data Matrix ECC200 Creator In VB.NET
Using Barcode encoder for .NET Control to generate, create Data Matrix 2d barcode image in VS .NET applications.
Data Matrix 2d Barcode Creator In None
Using Barcode maker for Word Control to generate, create ECC200 image in Word applications.
Now suppose we want to borrow $10,000 for 48 months at an annual interest rate of 9.5 percent, compounded monthly. Hence, P = 10,000, n = 48 and i = 9.5. Entering these values into their respective text boxes and clicking on the Go button, we obtain a monthly payment of $78.17, as shown in Fig. 6.15. This result is clearly incorrect, since 48 payments of $78.17 each returns only $3752.16 to the lender obviously much less than the original $10,000 loan, not to mention the interest that is also due.
Make Barcode In None
Using Barcode maker for Software Control to generate, create barcode image in Software applications.
Print EAN-13 Supplement 5 In C#.NET
Using Barcode drawer for .NET framework Control to generate, create EAN13 image in VS .NET applications.
Fig. 6.15
This error appears to be the result of faulty program logic. Hence, we will use the Visual Basic debugger to assist us in locating the source of the error. We first set a breakpoint at the statement
r = 0.01 * i / 12
as shown in Fig. 6.16. Note that the location of this breakpoint has been selected carefully so that it follows the entry of all input data, but precedes any internal calculations. Next, we select the variables P, n, i, r, f and A as watch values. These variables are listed (in alphabetical order) within the Watches window at the bottom of Fig. 6.16. Initially, we see the message <out of context> for the value of each variable, since the program has not been executed. We are now ready to run the program and initiate the debugging process. Hence, we enter the three given values (i.e., P = 10000, n = 48 and i = 9.5), as shown in Fig. 6.16, and then click on the Go button. The program then executes up to the breakpoint, as shown in Fig. 6.17. By examining the values in the Watches window, we verify that the input data have been entered correctly, but the calculated values of A, f and r are zero (because they have not been assigned values within the program). Note that the location of the breakpoint and the highlight indicating the location of the next executable statement coincide. (The location of the next executable statement can be identified in this case by the right-pointing arrow in the left margin, and the lighter color highlight.) We now take one step forward, by pressing function key F8 (to initiate Step Into). The result can be seen in Fig. 6.18. Now the watch value for r has changed from 0 to approximately 0.00792 (more precisely, 0.007916667). This value can easily be verified as being correct, since 0.01 9.5 / 12 = 0.007916667. The two remaining values for A and f are still zero, since these variables have not been assigned any values. Note that the location of the breakpoint is unchanged, as it should be, but the highlight indicating the next executable statement has moved down one line as a result of the step. Let us now step forward once more. Fig. 6.19 shows the results of this step. The watch value for f has now changed from 0 to 1.460098, and the remaining watch values are unchanged. A simple hand calculation (using a calculator) indicates that the value assigned to f is correct. Notice that the highlight indicating the next executable statement has again moved down one line, as a result of this latest step. Another step forward results in the watch value 78.17 being assigned to the variable A, as shown in Fig. 6.20. We have already noted that this value is incorrect. Since all of the previously calculated watch values are correct, however, we conclude that the error must be in the calculation of A. Closer inspection of this statement reveals a missing pair of parentheses in the denominator.
CHAP. 6]
Copyright © OnBarcode.com . All rights reserved.