package voltag; import java.util.Arrays; public class volt { double[] voltage = new double[72]; double mean; public volt(){} public volt(double[] Voltage) { this.voltage=Voltage; } public double calc_mean() { double avg=0; for (int i=0;i bigger || voltage[i] < smaller ) { hours10[count] = voltage[i]; count++; } } //from one to another by 15% double[] hours15 = new double[72]; int count2 = 0; while(count2 < 71) { for(int j = 0; j < voltage.length; j++) { int limit = voltage.length - 2; if(j <= limit) { double change = Math.abs(voltage[j] - voltage[j + 1]); if(change > mean * 1.15) { hours15[j] = voltage[j]; hours15[j+1] = voltage[j+1]; } } } count2++; } return "The hours more than 10% of mean are: " + Arrays.toString(hours10) + "\nAdjacent hours of voltage difference more than 15% of mean are: " + Arrays.toString(hours15); } }