コーヒーの価格を変換するためにこの JavaScript を完成させるのに問題があります..デバッガーをダウンロードしましたが、価格が定義されておらず、理解できないというメッセージが表示され続けます..スクリプトは次のとおりです..
<html>
<head>
<title>Coffee House</title>
</head>
<body>
<script type="text/javascript">
var drink, ounces, price;
prompt ( "Enter the drink type: espresso, latte, cappuccino, americano" );
prompt ( "Enter the oz: 8, 12, 16" )
var shots = prompt ( "Enter the number of shots" )
if ( drink == "espresso")
price = 1.40;
if (( drink == "latte") || (drink == "cappuccino" )) {
if ( ounce == 8 )
price = 1.95;
else if ( ounce == 12 )
price = 2.35;
else if ( ounce == 16 )
price = 2.75;
}
if ( drink == "americano" )
price = 1.20 + ( ( (ounce -8)/8 ) * .30 );
price = price + ( (shots) * .50 );
price = "price" * 1.055;
price = Math.round( price * 100 )/100;
alert( "Your " + ounce + "oz. " + drink + "with " + shots + "shots of espresso costs: $ " +price );
</script>
</body>
</html>