Open the VB2015Chap03Mileage SolutionMileage Solution (Mileage Solution.sln) file. The application displays the miles per gallon, given the

Question:

Open the VB2015\Chap03\Mileage Solution\Mileage Solution (Mileage Solution.sln) file. The application displays the miles per gallon, given the miles driven and gallons used. In the General Declarations section of the Code Editor window, enter your name, the current date, and the three Option statements. Use variables and the TryParse method to code the btnCalc_Click procedure. Use the Format function to display the miles per gallon with two decimal places. Save the solution and then start the application. Enter 324 and 17 as the miles driven and gallons used, respectively. The miles per gallon should be 19.06. Clear the screen. Now test the application using invalid data. More specifically, test it without entering any data, and then test it using letters as the input. When invalid data is entered, the Miles per gallon box will say either NaN (which stands for Not a Number) or Infinity. Both messages are a result of the miles per gallon calculation attempting to divide a Double number by the number 0.

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

Step by Step Answer:

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