В основном я пытаюсь создать программу доставки, но получаю сообщение об ошибке, которое я не могу отладить самостоятельно. Спасибо всем.
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
var totalPrice = 0;
var totalVolume = 0;
var totalItem = 0;
var numTrucks = 0;
var productArray = ["LT","ST","DC","LC","PR","SP","SW"]; // 0 1 2 3 4 5 6
var shippingvolumeArray = ["5.5","3","3.25","2","2.5","0.5","0.25"];
var unitpriceArray = [1000,600,650,800,375,350,275];
var productCode = Number(prompt("enter product code:"));
var Quantity = prompt("enter quantity");
do {
var productCode = prompt("enter product code:");
var Quantity = prompt("enter quantity:");
for (var i = 0; i<= productArray.length; i++) {
if (productCode == productArray[i]) {
totalPrice = totalPrice + unitpriceArray[i] * Quantity;
totalVolume = totalVolume + shippingvolumeArray[i] + Quantity;
totalItem = totalItem + Quantity;
}
}
document.write(totalPrice);
}
</script>
</body>
</html>