public void InputProduct() { // Manufacturer input. Console.Write("Enter manufacturer of product: "); do { Manufacturer = Console.ReadLine(); if (Manufacturer.All(char.IsLetterOrDigit)) { break; } else { Console.WriteLine("Name of manufacturer should only consist of letters and digits!"); } } while (Manufacturer == null); // Type of item input. Console.Write("Enter type of item: "); do { TypeOfItem = Console.ReadLine(); if (TypeOfItem.All(char.IsLetter)) { break; } else { Console.WriteLine("Type of product should only consist of letters!"); } } while (TypeOfItem == null); // Price input. double tempPrice = new double(); while (double.TryParse(Console.ReadLine(), out tempPrice) == false) { Console.Write("Wrong price input! Try again: "); } Price = tempPrice; // Dimension input. double tempDimension = new double(); while (double.TryParse(Console.ReadLine(), out tempDimension) == false) { Console.Write("Wrong dimension input! Try again: "); } Dimension = tempDimension; }