Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The code should be written in HTML 5. Thanks! Develop a script that will determi

ID: 3819299 • Letter: T

Question

The code should be written in HTML 5. Thanks! Develop a script that will determine whether a department-store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available: a) Account number b) Balance at the beginning of the month c) Total of all items charged by this customer this month d) Total of all credits applied to this customer's account this month e) Allowed credit limit The script should input each of these facts from a prompt dialog as an integer, calculate the new balance (= beginning balance + charges - credits), display the new balance and determine whether the new balance exceeds the customer's credit limit. For customers whose credit limit is exceeded, the script should output HTML5 text that displays the message "Credit limit exceeded."

Explanation / Answer

<!DOCTYPE html>
<html>
    <script>
      var account_no=parseInt(prompt("Enter your account number : ","000"));
      var balance=parseInt(prompt("Enter your balance at the beginning of the month : ","000"));
      var total_item=parseInt(prompt("Enter your total of all items charged :",""));
      var total_credit=parseInt(prompt("Enter your total of all credits :",""));
      var allow_credit=parseInt(prompt("Enter your allowed credit limit :",""));
      var new_balance=parseInt(balance+total_item-total_credit);
      document.write("<h1> The new balance is "+new_balance+"</h1>");
      if(new_balance>allow_credit)
      document.write("Your credit limit is exceeded.");
    </script>
</head>

<body>
  
</body>
</body>

</html>