Open the VB2015Chap04Debug SolutionDebug Solution (Debug Solution.sln) file. Open the Code Editor window and review the existing

Question:

Open the VB2015\Chap04\Debug Solution\Debug Solution (Debug Solution.sln) file. Open the Code Editor window and review the existing code. The btnCalc_Click procedure should calculate a 5% commission when the code entered by the user is 1, 2, or 3 and, at the same time, the sales amount is greater than $5,000; otherwise, the commission rate is 3%. Also, the CancelKeys procedure should allow the two text boxes to accept only numbers, the period, and the Backspace key.

a. Start the application. Type the number 1 in the Code box and then press the Backspace key. Notice that the Backspace key is not working correctly. Stop the application and then make the appropriate change to the CancelKeys procedure.

b. Save the solution and then start the application. Type the number 12 in the Code box and then press the Backspace key to delete the 2. The Code box now contains the number 1.

c. Type 2000 in the Sales amount box and then click the Calculate button. A message box appears and indicates that the commission amount is $100.00 (5% of $2,000), which is incorrect; it should be $60.00 (3% of $2,000). Close the message box. Stop the application and then make the appropriate change to the btnCalc control’s Click event procedure.

d. Save the solution and then start the application. Type the number 1 in the Code box. Type 2000 in the Sales amount box and then click the Calculate button. The message box should indicate that the commission amount is $60.00. Close the message box.

e. Test the application using the data shown in Figure 4-59.

Code Sales amount 7000 5000 5000.75 175.55 9000.65 1 2 3 3 4 4 2000 6700

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: