Help

Discussion in 'The Lounge' started by darine, Jul 2, 2006.

  1. darine

    darine

    Joined:
    Jun 30, 2006
    Messages:
    2
    Likes Received:
    0
    Ok I think I figured it out but I am unable to get my calculation: here is the code


    public class Commission
    {
    public static void main(String args[])
    {
    int salesp[];
    salesp= new int [15];
    int salespw[]={500,1000,350,625,5000,200,280,230,290,376,610,2000,350,100,150};
    double commision=.09;
    double total;
    {

    System.out.printf( "%5s%8s\n", "Salesper", "Sales per Week" );

    {
    for(int counter=0;counter < salespw.length; counter++)
    System.out.printf("%5d%8d\n", counter, salespw[ counter ]);
    }

    {
    for ( int counter = 0; counter < salespw.length; counter++ )
    total += salespw[ counter ]*commission;
    System.out.println("%5d%8d\n",'Your commission is: ',commission);
    }
    }

    }

    }
     
    darine, Jul 2, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.