I need a little help about showing all inputted arrays.
float[] month;
month = new float[12];
for (int counter=0; counter<12; counter++) {
float revenueMonths = Float.parseFloat(JOptionPane.showInputDialog("Revenue month of " + (counter + 1)));
month[counter] = revenueMonths;
totalRev = totalRev + month[counter];
}
As you can see from my code, it is asking the user to input the revenue of each month. The value of months for revenue is not declared, it will be declared by the user inputs.
So, if a user inputs each month revenue as:
month 1 : 100
month 2 : 100
till 12 : 100
I want to print out the revenues of each month
month 1 : 100
month 2 : 100
m 3 : 100
till 12 : 100
How do I do that? Thank you!