So right now I need to make a program that can determine if several department store customers have exceeded their credit limit on a charge account. I have the 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 customer's account this month, and the allowed credit limit. It needs to input all of these as integers and calculate the new balance using "= beginning balance + charges - credit", display the balance, and determine if it exceeds their credit limit, and display a message if it has exceeded it.
I have the general format down (I hope),
import java.util.Scanner; public class Credit { //calculates the balance on several credit accounts public void calculateBalance() { Scanner input = new Scanner( System.in ); int account; //account number int oldBalance; //starting balance int charges; //total charges int credits; //total credits int creditLimit; //allowed credit limit int newBalance; //new balance System.out.print( "Enter Account Number (or -1 to quit): " ); int i = scan.nextInt(); //stuff I need to figure out } }
I've been at this for hours and I can't figure this out. I'm not asking for like full answers just things to help me get on the right track.