Question

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

Here is the code:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p id="demo"> </p>
<p id="demo2"></p>
<script>
var acc=prompt("Enter ac/n");
var balbeg=prompt("Enter balance at beginning");
var charges=prompt("Enter total of all items");
var credits=prompt("Enter total of all credits");
var credlimit=prompt("Enter allowed credit limit");

var newbal=0;
newbal=Number(balbeg)+Number(charges)-Number(credits);
document.getElementById("demo").innerHTML= "New balance is: "+newbal;

if(Number(newbal)>Number(credlimit)){
document.getElementById("demo2").innerHTML= "exceeded";
}
</script>

  
</body>
</html>

Add a comment
Know the answer?
Add Answer to:
i need to Develop a script in java script that will determine whether a department-store customer...
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
  • 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...

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

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

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

  • write in java and you must use methods.... Part I     Internet Service Provider An Internet service...

    write in java and you must use methods.... Part I     Internet Service Provider An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill....

  • Need help in trying to get my java program to work, Its finished but i still...

    Need help in trying to get my java program to work, Its finished but i still have errors left when i compile WHy do i get this error message"Illegal start of expression void displaysummary() " When i try to complie my java program ? import java.io.*;    public class prog23 {    public static void main(String[] args) throws I0Exception    {        program23 app = new program23();        app.appMain();    } } class program23 {       BufferedReader...

  • Java 1. Develop a program to emulate a purchase transaction at a retail store. This program...

    Java 1. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual line item of merchandise that a customer is purchasing. The Transaction class will combine several LineItem objects and calculate an overall total price for the line item within the transaction. There will also be two test classes, one for the LineItem class and one for the...

  • Using Java You are helping a corporation create a new system for keeping track of casinos...

    Using Java You are helping a corporation create a new system for keeping track of casinos and customers. The system will be able to record and modify customer and casino information. It will also be able to simulate games in the casino. Customer-specific requirements You can create new customers All new customers have a new customerID assigned to them, starting with 1 for the first, 2 for the second, 3 for the third, ect. New customers have names and monetary...

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

  • The second two pictures are the questions I need help with. I started to fill in...

    The second two pictures are the questions I need help with. I started to fill in the first question but don't know if it is correct. Thanks! Problem 4-3A Prepare the bank reconciliation and record cash adjustments (L04-5) [The following information applies to the questions displayed below.) The cash records and bank statement for the month of May for Diaz Entertainment are shown below. DIAZ ENTERTAINMENT Cash Account Records May 1, 2018, to May 31, 2018 Cash Balance May 1,...

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
ADVERTISEMENT