내가 디버거를 다운로드하고 그 가격이 정의이고, 내가 스크립트가 understand..here입니다 해달라고 말해 계속 커피 prices..I 변환이 자바 스크립트를 마무리하는 데 문제가 있어요 ..자바 스크립트 계산기
<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>
var 문에 가격을 추가해보십시오. –
가격은 로컬이며, var drink, ounces, orice를 사용하여 글로벌하게 만듭니다. – Satya
정확히 어떻게하는지 설명 할 수 있습니까? – user1371539