PLEASE help me with a code
Write a program which accepts non-negative double type of numbers as income amounts one by one until a negative number is entered, and the negative number ends the program. When the program is completed by entering a negative number, it prints out the minimum, average, and maximum for the set of entered incomes(excluding the last negative number). For the average, min, max , you always show at most two decimal numbers. Assume the largest number can be entered by user is 1,000,000.00. What I have so far: public static void main(String [ ] args) { Scanner sc = new Scanner(System.in); System.out.print(Enter an income (any negative number to quit:"); double sum = 0; double max = 1,000,000.00; double min = Double.MAX_VALUE; int count = 0; double nextDouble; while (sc.hasNext( ) ) { next Double = sc. nextDouble( ) ; max = Math. max (max, nextDouble); if ( nextDouble < 0) { break; }else { min = Math. min(nextDouble, min); sum += nextDouble; count++; } } System.out.println("Average: " + sum/count); System.out.println("Min: " + min); System.out.println("Max: " + max); } }