Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: What is this question asking?

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

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


    import javax.swing.JOptionPane;
    import java.text.DecimalFormat;

    public class Project4
    {
    public static void main(String[] args)
    {

    String inputString;
    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");
    else
    JOptionPane.showMessageDialog(null, "Credit limit exceeded");


    System.exit(0);

    }
    } //end Project4


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: What is this question asking?

    Quote Originally Posted by shin777 View Post
    does it ask me to make java application that dialog box ask # for each variable and produce result
    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."
    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

  3. #3
    Junior Member
    Join Date
    Jun 2013
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

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