Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Intro JAVA class very basic understanding and basic functions Develop a Java application that determines whether any of several department-store customers has exceeded the credit

Intro JAVA class very basic understanding and basic functions Develop 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 available:

account number

balance at the beginning of the month

total of all items charged by the customer this month

total of all credits applied to the customers account this month

allowed credit limit.

The program should input all these facts as integers, calculate the new balance (= beginning balance + charges credits), display the new balance and determine whether the new balance exceeds the customers credit limit. For those customers whose credit limit is exceeded, the program should display the message "Credit limit exceeded." Call the class Credit.

Some of the code is here. You will need to fill in the code to calculate and display new balance below the comment. Youll need one line of code to calculate the new balance, and another line of code to display the new balance. Be sure to comment both lines of your code.

image text in transcribed

// Exercise 4.18 Solution: Credit.java // Program monitors accounts. import java.util.Scanner; public class Credit Icalculates the balance on several credit accounts public static void main(Stringll args) Scanner input -new Scanner(System.in); System.out.print"Enter Account Number (or-1 to quit):" int account input.nextint(); // read in account number //exit if the input is -1; otherwise, proceed with the program while (account --1) System.out.print("Enter Balance:"); double oldBalance input.nextDouble(); // read in original balance System.out.print("Enter Charges: "); double charges - input.nextDouble):// read in charges System.out.print"Enter Credits: "); double credits input.nextDouble); // read in credits System.out.print("Enter Credit Limit:") double creditLimit input.nextDouble();I/ read in credit limit // calculate and display new balance

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions