私は C# を学び始めていますが、現時点では、変数が期待どおりに更新されていません。
string Carpet,
tempCarpet;
Double carpetPrice;
do{
Console.WriteLine("What type of carpet do you want: ");
Console.Write("1. Berber ($3.75) | 2. Plush ($4.62) | 3. Barbed ($9.98)");
tempCarpet = Console.ReadLine();
if (tempCarpet == "1") {
Carpet = "Berber";
carpetPrice = 3.75;
} else if (tempCarpet == "2") {
Carpet = "Plush";
carpetPrice = 4.62;
} else if (tempCarpet == "3") {
Carpet = "Barbed";
carpetPrice = 9.98;
} else
Console.WriteLine("Invalid Selection.");
}while(tempCarpet != "1"|tempCarpet != "2"|tempCarpet !="3");
Console.WriteLine("The Carpet" + Carpet + "costs {0:C}", carpetPrice);
` Use of unassigned local variable というエラーが表示されます。人が望む「カーペット」を選択するオプションが欲しいので、私はそれをこの種の形式にしたいと考えています。この問題の解決策を知っている人はいますか?