Question

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

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."

0 0
Add a comment Improve this question Transcribed image text
Answer #1

<!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>

Add a comment
Know the answer?
Add Answer to:
The code should be written in HTML 5. Thanks! Develop a script that will determine whether...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • i need to Develop a script in java script that will determine whether a department-store customer...

    i need to Develop a script in java 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...

  • 7.11 Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track...

    7.11 Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording the number of miles driven and the number of gallons used for each tankful. Develop a script that will take as input the miles driven and gallons used (both as integers) for each tankful. The script should calculate and output HTML5 text that displays the number of miles per gallon obtained for each tankful and the combined...

  • Write a Java application that determines whether any of several department store customers has exceeded the...

    Write a Java application that determines whether any of several department store customers has exceeded the credit limit on a charge account. For each customer, the following facts are inputted: -Balance at beginning of month -Total amount of all items charged by the customer this month -Total amount of all credits applied to the customer’s account this month -Allowed credit limit Use the value of -1 as a sentinel value to quit the program. The program should input all these...

  • Write a Java application that determines whether any of several department store customers has exceeded the...

    Write a Java application that determines whether any of several department store customers has exceeded the credit limit on a charge account. For each customer, the following facts are inputted: Account number Balance at beginning of month Total amount of all items charged by the customer this month Total amount of all credits applied to the customer’s account this month Allowed credit limit Use the value of -1 as a sentinel value to quit the program. The program should input...

  • Develop a script that will determine the gross pay for each of threeemployees. The company pays...

    Develop a script that will determine the gross pay for each of threeemployees. The company pays “straight time” for the first 40 hours worked by each employee and pays “time and a half” for all hours worked in excess of 40 hours. You’re given a list of the employees of the company, the numberofhourseachemployeeworkedlastweekandthehourlyrateofeachemployee.Yourscript should input this information for each employee, determine the employee’s gross pay and output HTML5 text that displays the employee’s gross pay. Use prompt dialogs to...

  • You work in the IT group of a department store and the latest analytics shows there...

    You work in the IT group of a department store and the latest analytics shows there is a bug that allows customers to go over their credit limit. The company's president has asked you to develop a new algorithm to solve this problem. Create your algorithm using pseudocode that determines if a department store customer has exceeded their credit limit. Be sure you gather the following inputs from the user: Account number Balance of the account Total cost of all...

  • This C++ Program should be written in visual studio 2017 You are to write a program...

    This C++ Program should be written in visual studio 2017 You are to write a program that can do two things: it will help users see how long it will take to achieve a certain investment goal given an annual investment amount and an annual rate of return; also, it will help them see how long it will take to pay off a loan given a principal amount, an annual payment amount and an annual interest rate. When the user...

  • Use the following to answer questions 5-8 Bank Reconciliation: Identify whether the item should be added...

    Use the following to answer questions 5-8 Bank Reconciliation: Identify whether the item should be added or subtracted from the bank balance or the company balance. Use the number 1-4) for your response. For instance, if the amount should be added to bank statement balance you would input 1. 1. Added to bank statement balance 2. Subtracted from bank statement balance 3. Added to company cash balance 4. Subtracted from company cash balance 6 7 8 Item Bank deducted too...

  • write a code on .C file Problem Write a C program to implement a banking application...

    write a code on .C file Problem Write a C program to implement a banking application system. The program design must use a main and the below functions only. The program should use the below three text files that contain a set of lines. Sample data of these files are provided with the assessment. Note that you cannot use the library string.h to manipulate string variables. For the file operations and manipulations, you can use only the following functions: fopen(),...

  • Use the following to answer questions 1-4 Determine whether the firm reports each of the following...

    Use the following to answer questions 1-4 Determine whether the firm reports each of the following items as part of cash, cash equivalents, or neither in the balance sheet Item Cash, Cash equivalent, or neither 1 Inventory for sale to customers Investment with a maturity of 80 days at purchase Three month US Treasury Bill Bank deposits Use the following to answer questions 5-8 Bank Reconciliation: Identify whether the item should be added or subtracted from the bank balance or...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT