Question: Open the VB2015Chap03Mileage SolutionMileage Solution (Mileage Solution.sln) file. The application displays the miles per gallon, given the miles driven and gallons used. In the General
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.
Step by Step Solution
3.36 Rating (168 Votes )
There are 3 Steps involved in it
Microsoft Visual Studio Solution File Format Version 1200 Visual Studio 14 VisualStudioVersion 140225120 MinimumVisualStudioVersion 100402191 ProjectF184B08FC81C45F6A57F5ABD9991F28F Mileage Project Mi... View full answer
Get step-by-step solutions from verified subject matter experts
