// Directions: Practice #5-2
// 1) Run the following code to see the error.
// 2) DO NOT change the coding currently in lines 15 through 18 at any point in this exercise.
// 3) Add a try catch structure with an Exception with ex in the parenthesis to keep the application from crashing.
/* 4) If an error occurs, Console.WriteLine should say the the following : "Error: Input string was not in a correct format.", WHILE USING ex.Message. Refer to the bottom of
p. 159 in the text for help with this */
// 5) Submit your dotnetfiddle link in Blackboard.
// If correctly coded, you should see the following when you run the program: Error: The input string '' was not in a correct format.
using System;
public class Program
{
public static void Main()
float fltHP = 0;
string strHP = "";
fltHP = float.Parse(strHP);
Console.WriteLine("Value: " + fltHP);
}