What is this question asking?
Use decision logic to develop a Java application that determines whether a department store customer has exceeded the credit limit on their charge account.
1. Account number
2. Balance at the beginning of the month
3. Total of all items charged by the customer this month
4. Total of all credits applied to the customer’s account this month
5. Allowed credit limit
The program should accept as input (from dialog boxes) all of these facts as integers, calculate the new balance, display the new balance in a dialog box, and determine whether the new balance exceeds the customer’s credit limit. When the customer is within the limit, the program should produce a dialog box providing the account number on one line and the words “Good Credit” on the second line. When the customer is not within the limit, the program should produce a dialog box providing the account number on one line and the words “Credit limit exceeded” on the second line.
*credit = payment
does it ask me to make java application that dialog box ask # for each variable and produce result or does it ask me to create java program with preset values(like I use my own numbers for each variable, for example, account # = 123, balance at beginning = $372, etc) and program produce result in 2 seperate dialog boxes(1st box shows account # and new balance, 2nd shows whether my credit is good or not)?
This is what my teacher replied.
"You will prompt me for each of the values I listed on the assignment. You will do the calculations, and then provide two separate dialog boxes. The first tells me my balance, the other tells me if I''m under or exceeded my credit limit."
So how am I suppose to start? I already know how to write these but instruction seems very unclear to me.
This is example code I wrote but not sure if this is what this instruction is asking me to do.
public class Project4
public static void main(String args)
int account = 1573201; //account number
int beginningBalance = 425; //balance at the beginning of the month
int totalItemCharged = 520; //total of all items charaged by customer this month
int totalCreditApplied = 300; //credit applied
int allowedCreditLimit = 1500; //allowed credit
int newBalance = (totalItemCharged+beginningBalance)-totalCreditApplied; //calculation for new balance
DecimalFormat formatter = new DecimalFormat("#0");
JOptionPane.showMessageDialog(null, "Your account # is " + account + ". Your new balance is $" + formatter.format(newBalance));
if (newBalance < allowedCreditLimit)
JOptionPane.showMessageDialog(null, "Good Credit");
JOptionPane.showMessageDialog(null, "Credit limit exceeded");
} //end Project4
Re: What is this question asking?
You will prompt (accept input through a dialog box) me for each of the values listed (1-5), and then do the calculations, and then provide TWO additional dialog boxes, one to display the balance and the other to determine good credit or exceeded limit. So it looks like you will open 7 dialogs total
Originally Posted by shin777
Re: What is this question asking?
That's what I was thinking but then again, I got burned on previous project when I did that. Previous one was
My teacher never answer any of my questions straight and he tells me he doesn't know how he can make instructions any clearer than it already is and suggested me to get help from tutors.