Results 1 to 6 of 6
  1. #1
    kudinspurs is offline Member
    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Default Java Assignment Help!

    1st - can someone help me make a complete program contain loops, array....

    2nd - can this program combine with array? please help..

    import javax.swing.JOptionPane;
    public class excercise4_39 {
    public static void main (String[]Args){
    String commissionS = JOptionPane.showInputDialog("Enter the amount of the commission you would like to have:");
    int desiredCommission = Integer.parseInt(commissionS);
    int salesAmount = 0;
    double commissionRate = 0;
    double commissionAmount = 0;
    System.out.println("Sales Amount" + "\t\t" + "Commission Rate" + "\t\t" + "Commission Amount");

    for (salesAmount=1; salesAmount >= commissionAmount;salesAmount++){
    if(salesAmount <= 5000){
    commissionRate = 0.08;
    }
    if(salesAmount >= 5001 && salesAmount <= 10000){
    commissionRate = 0.10;
    }
    if(salesAmount >= 10000){
    commissionRate = 0.12;
    }
    salesAmount += 999;
    commissionAmount = salesAmount * commissionRate;
    System.out.println(salesAmount + "\t\t\t" + commissionRate + "\t\t\t" + commissionAmount);
    if(commissionAmount>=desiredCommission){
    break;}
    }
    JOptionPane.showMessageDialog(null, "To earn a commission amount of €" + desiredCommission + " , Your sale amount has to reach about €" + salesAmount);
    }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,028
    Rep Power
    23

    Default Re: Java Assignment Help!

    Please go through the Forum Rules -- particularly the third paragraph.
    Also go through http://www.java-forums.org/forum-gui...w-members.html and BB Code List - Java Programming Forum and edit your post accordingly.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,028
    Rep Power
    23

    Default Re: Java Assignment Help!

    Quote Originally Posted by kudinspurs View Post
    1st - can someone help me make a complete program contain loops, array....
    No, this is a forum -- not a code factory.

    Quote Originally Posted by kudinspurs View Post
    2nd - can this program combine with array? please help..
    You mean the program code you lifted from http://www.java-forums.org/new-java/...e-program.html without accrediting the author?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,028
    Rep Power
    23

    Default Re: Java Assignment Help!

    Quote Originally Posted by kudinspurs View Post
    1st - can someone help me make a complete program contain loops, array....

    2nd - can this program combine with array? please help..

    import javax.swing.JOptionPane;
    public class excercise4_39 {
    public static void main (String[]Args){
    String commissionS = JOptionPane.showInputDialog("Enter the amount of the commission you would like to have:");
    int desiredCommission = Integer.parseInt(commissionS);
    int salesAmount = 0;
    double commissionRate = 0;
    double commissionAmount = 0;
    System.out.println("Sales Amount" + "\t\t" + "Commission Rate" + "\t\t" + "Commission Amount");

    for (salesAmount=1; salesAmount >= commissionAmount;salesAmount++){
    if(salesAmount <= 5000){
    commissionRate = 0.08;
    }
    if(salesAmount >= 5001 && salesAmount <= 10000){
    commissionRate = 0.10;
    }
    if(salesAmount >= 10000){
    commissionRate = 0.12;
    }
    salesAmount += 999;
    commissionAmount = salesAmount * commissionRate;
    System.out.println(salesAmount + "\t\t\t" + commissionRate + "\t\t\t" + commissionAmount);
    if(commissionAmount>=desiredCommission){
    break;}
    }
    JOptionPane.showMessageDialog(null, "To earn a commission amount of €" + desiredCommission + " , Your sale amount has to reach about €" + salesAmount);
    }
    }
    Quoting the entire OP for record.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    kudinspurs is offline Member
    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Default Re: Java Assignment Help!

    Quote Originally Posted by DarrylBurke View Post
    Quoting the entire OP for record.

    db
    can u help me make this program with array? tq

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,028
    Rep Power
    23

    Default Re: Java Assignment Help!

    Quote Originally Posted by kudinspurs View Post
    can u help me make this program with array? tq
    Help you? yes. do it for you? no.

    I recommend you ignore the code you lifted from an old thread and make a fresh start. Anywhere you get stuck, ask a specific question and you're sure to get help.

    Before you ask, you could try to find a solution in The Java™ Tutorials .

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Help with java assignment
    By jason3460 in forum New To Java
    Replies: 6
    Last Post: 12-04-2012, 11:47 PM
  2. java assignment
    By drewjordan in forum New To Java
    Replies: 9
    Last Post: 01-16-2012, 12:44 AM
  3. Java Assignment Help
    By nve5009 in forum New To Java
    Replies: 4
    Last Post: 04-27-2011, 06:36 AM
  4. Need Help with Java Assignment
    By smurf67 in forum New To Java
    Replies: 4
    Last Post: 03-26-2011, 11:25 AM
  5. Java assignment
    By xtianah77 in forum New To Java
    Replies: 1
    Last Post: 02-18-2008, 12:54 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •