I have created a gui which is supposed to print calculations in a text area, however nothing prints when I hit the run report button.
This is the snippet of code I am using. I am very new to java and to programming, so any help would be appreciated.
[code]
int columns = 2;
int rows = earnings.length;
double totalTime = 0.00;
double totalPayment = 0.00;
double averageWages =0.00;
double minWage =7.00;
String report = new String();
for (int j=0;j<columns;j++){
for(int i=0;i<rows;i++){
if (j==0){
totalTime+= earnings[i][j];
}
else if(j==1){
totalPayment+= earnings[i][j];
}
}
}
jTextArea1.append("\n\n");
jTextArea1.append("Report of your wages to Date\n\n");
jTextArea1.append("\n");
if (earnings.length>0){
averageWages = totalPayment/(totalTime/60);
}
//Displays in text area
jTextArea1.append("Average Per Hour Wage $ " + averageWages + "\n");
jTextArea1.append("\n\n");
jTextArea1.append("Minimum Wage is currently $6.55");
jTextArea1.append("\n\n");
if(averageWages<minWage){
jTextArea1.append("Your average wages per hour are below Average");
}else if(averageWages>=minWage && averageWages<=minWage * 2.00){
jTextArea1.append("Your average wages per hour are average");
}else if(averageWages > minWage * 2.00){
jTextArea1.append("Your average wages per hour are above Average");
}
jTextArea1.append("Total Minutes Spent Tutoring = " +totalTime + "\n");
jTextArea1.append("Total Earnings = $ " +totalPayment+ "\n");
//calculates average per hour wage
jTextArea1.append(report);
}
[code]