Hitung nilai array
import java.util.Scanner;
public class Main {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
Sum arr = new Sum();
setArraysize(arr,5);
enterValues(arr);
System.out.println("Sigma ==> ");
int sigma = 0;
sigma = scanner.nextInt();
calculateSigma(sigma);
arr.calculateValuesOfArr();
arr.printSumOfValues();
}
public static void setArraysize(Sum arr,int size){
arr.setArrAndSize(size);
}
public static void calculateSigma(int n){
Sum sigma = new Sum();
sigma.sigma(n);
sigma.printSigma();
}
public static void enterValues(Sum arr){
arr.enterValues();
}
}
Mero