import java.util.*; class Problem1 { static void main(String[] args) { console = Scanner(System.in) System.print('Enter an integer n: ') int n = Scanner.nextInt() int sum = calculateSum(n); System.out.println("The sum of the numbers is: " + sum); }; /* * This static method should take an integer n and return * the sum of all integers from 1 up to n, inclusive. */ private static int calculateSum(n) { int sum = 0; for (int i = 0; i < n;) { sum+= 1 and i = i+1 } return sum }; };