Question

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 facts, 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 those customers whose credit limit is exceeded, the program should display the message “Credit limit exceeded”.

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

import java.util.Scanner;


class DepartmentalStore
{
  
public static void main(String[] args)
{
int account_number, begining_balance, total_charges, total_credits, credit_limit, new_balance;
Scanner sc = new Scanner(System.in);
  
  
System.out.print("\n Enter Account Number (-999 for exit): ");
account_number = sc.nextInt();
  
  
while(account_number != -999)
{
  
System.out.print("\n Enter Balance at the beginning of the month: $");
begining_balance = sc.nextInt();
  
  
System.out.print("\n Enter total of all items are charged by the customer this month: $");
total_charges = sc.nextInt();
  
  
System.out.print("\n Enter Total of all credits applied to the customer's account this month: $");
total_credits = sc.nextInt();
  
  
System.out.print("\n Enter allowed credit limit: $");
credit_limit = sc.nextInt();
  
  
new_balance = begining_balance + total_charges - total_credits;
  
  
System.out.println("\n Customer New Balance: $" + new_balance);
  
  
if(new_balance > credit_limit)
System.out.println("\n Credit limit exceeded \n");
else
System.out.println("\n With in the Limit \n");
  
System.out.print("\n Enter Account Number (-999 for exit): ");
account_number = sc.nextInt();
}
}
}CWindows)system32\cmd.exe F:NJava>javac Departmentalstore-java F:Java>jva DepartmentalStore Enter Account Number <-999 for ex

Add a comment
Know the answer?
Add Answer to:
Write a Java application that determines whether any of several department store customers has exceeded the...
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...

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

  • 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 an application in java that reads in a five-digit integer and determines whether it is...

    Write an application in java that reads in a five-digit integer and determines whether it is a palindrome. If the number is not five digits long, display an error message and allow the user to enter a new value. Tips: 1. Determine the number of digits in the value input by the user , i.e. prompt the user to enter the number of digits of the number. Use a while loop to determine whether the user input contains the proper...

  • Write a C++ program to manage a credit card company with at least one ADT (Account)...

    Write a C++ program to manage a credit card company with at least one ADT (Account) with the following members: card number, customer name, credit limit, and balance. • The customer can pay the total amount of his/her balance or part of it. • The customer can make a purchase using the credit card. • The user can create, modify, and delete accounts. • All new accounts are created with $300 credit limit. • Customers’ data is stored in a...

  • Write in java language ================== Office Supplies Inc., an office supply store, services many customers. As...

    Write in java language ================== Office Supplies Inc., an office supply store, services many customers. As customers’ orders for office supplies are shipped, information is entered into a file. Office Supplies bills their customers once each month. At the end of each month, the Chief Executive Officer requests a report of all customers sorted by their customer id (from lowest to highest). The report includes their bill balance and tax liability. Write a program to produce the outstanding balance report...

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

  • Write a complete Java program called "AtmSimDoLoop" (without the quotation marks) according to the following specifications....

    Write a complete Java program called "AtmSimDoLoop" (without the quotation marks) according to the following specifications. It should use a do-while loop to prompt the user with the following starting prompt (without the horizontal lines) until the user enters 4 to quit. The program should start with an initial account balance, which you can set to any legitimate double value. Prompt the user with the following prompt (without the horizontal lines). Enter the number of your desired transaction type. Deposit...

  • In C++ Create an inheritance hierarchy that a bank might use to represent customers’ bank accounts. All customers at this bank can deposit (i.e., credit) money into their accounts and withdraw (i.e.,...

    In C++ Create an inheritance hierarchy that a bank might use to represent customers’ bank accounts. All customers at this bank can deposit (i.e., credit) money into their accounts and withdraw (i.e., debit) money from their accounts. More specific types of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, charge a fee per transaction (i.e., credit or debit). Create an inheritance hierarchy containing base class Account and derived...

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