I want to output the annual salary for each employee individually but I'm not sure how. The way it is now it just pops up as one large box.

Any help is much appreciated :)

 public static void main(String[] args) {
        // TODO code application logic here

    String increase, 
            output = "";

    double percentIncrease, 

    for(int count = 1; count <= 10; count++ ){

        Salary = JOptionPane.showInputDialog("Enter Employee wage " + count );

        AnnualSalary = Double.parseDouble(Salary);

        increase = JOptionPane.showInputDialog("Enter Percentage Increase for Employee " + count);

        percentIncrease = Double.parseDouble(increase);

        for(int year = 1; year <= 4; year++ ){

             AnnualSalary += ( percentIncrease / 100 )* AnnualSalary;

             output += "The new salary for year " +  count  + " is " +  + AnnualSalary + "\n";



    JOptionPane.showMessageDialog(null, output);


did you write this code yourself ? somehow, it seems to me that if you did, you would have know how to do so.

in your iteration, don't add the text to print to a variable called output, just put the JOptionPane.showMessageDialog as last command in the loop, and replace the 'output' variable by the text to print.

My tutor help me out with the code but did not in to detail about the output message, that and I'm a bit rusty after the Christmas break

you said, "I want to output the** annual** salary ".It means in your output message you should include the the variable that is storing this value.
for example:System.out.println(myAnnualVariable);. However, in your case use

Thanks for the help :)
This article has been dead for over six months. Start a new discussion instead.