Сейчас я преобразовал все три строки в целое число, но у меня возникли проблемы с преобразованием каждой строки с помощью метода Double.TryParse. Я хочу использовать этот метод вместо int.
Я пробовал использовать этот тип кода if (Double.TryParse(value, out Number)), но не уверен, правильно ли это.
//Ask the user for height
Console.Write("Please enter the first part of your height in feet:");
string _height = Console.ReadLine();
int _heightVal = Int32.Parse(_height);
//Ask the user for inches
Console.Write("Please enter the second part of your height in inches:");
string _inches = Console.ReadLine();
int _inchesVal = Int32.Parse(_inches);
//Ask the user for pounds
Console.Write("Please enter your weight in pounds:");
string _pounds = Console.ReadLine();
int _poundsVal = Int32.Parse(_pounds);
Подробнее здесь: https://stackoverflow.com/questions/555 ... in-c-sharp