Курсовая работа: Метод последовательных сравнений
JOptionPane.showMessageDialog(this, "Принятыеоценкикорректны");
}
private int checkConditions() {
return checkConditions(conditions.size()-1, values);
}
private boolean isConditionSelected(int numCondition){
return vec.get(numCondition).isSelected();
}
private int checkConditions(int lastCondition, float[] values) {
for (int i = 0; i <= lastCondition; i++) {
boolean selected = isConditionSelected(i);
if (calculute(i, values) == !selected) {
return i;
}
}
return -1;
}
private boolean calculute(int i, float[] values) {
int[] indices = conditions.get(i);
float leftValue = values[indices[0]];
float summ = 0;
for (int j = 1; j < indices.length; j++) {
summ += values[indices[j]];
}
return leftValue > summ;
}
private float getSumm(int i, float[] values) {
int[] indices = conditions.get(i);
float summ = 0;