private void ReadUnitPrice()
{
Console.Write("Enter the unit gross price: ");
unitPrice = double.Parse(Console.ReadLine());
}
这应该是可行的,但我错过了一些显而易见的东西。每当我输入一个双精度浮点数时,它会给我一个错误:System.FormatException: 输入字符串格式不正确。请注意,'unitPrice'被声明为double类型。