input_goal_st = JOptionPane.showInputDialog(null, "Input your targe commission of this year", "Calculation of commission",
JOptionPane.QUESTION_MESSAGE);
input_goal_int = Integer.parseInt(input_goal_st);
for(i = 1; i <= 3; i++) {
switch(i) {
case 1 : x = range_1; y = limit_high_1; z = rate_1; w = limit_low_1;
break;
case 2 : x = range_2; y = limit_high_2; z = rate_2; w = limit_low_2;
break;
case 3 : x = range_3; y = limit_high_3; z = rate_3; w = limit_low_3;
break;
}
mini_amount = (w * total_month);
sale_amount = (base_salary) + (y * (z / 100) * total_month);
if (sale_amount >= input_goal_int) {
sale_amount_final = (input_goal_int - base_salary) * (100 / z);
if ( sale_amount_final >= mini_amount) {
System.out.println("The sale amount to meet your goal is " + sale_amount_final + "\nCommission rate is " + z + "\nSales amount range is " + x);
JOptionPane.showMessageDialog(null, "The sale amount to meet your goal is " + sale_amount_final + "\nCommission rate is " + z + "\nSales amount range is " + x, "The information of the calculation", JOptionPane.INFORMATION_MESSAGE);
} else {
continue;
}
} else if(i == 3) {
sale_amount_final = (input_goal_int - base_salary) * (100 / rate_3);
if ( sale_amount_final >= mini_amount) {
System.out.println("The sale amount to meet your goal is " + sale_amount_final + "\nCommission rate is " + z + "\nSales amount range is " + x);
JOptionPane.showMessageDialog(null, "The sale amount to meet your goal is " + sale_amount_final + "\nCommission rate is " + z + "\nSales amount range is " + x, "The information of the calculation", JOptionPane.INFORMATION_MESSAGE);
} else {
continue;
}
} else {
continue;
}
}
}
}
歡迎光臨 中央論壇 - CENTER BBS (https://www.centerbbs.com/)