A teacher wants to calculate how many students failed the ex…

A teacher wants to calculate how many students failed the exam. A student is considered to have failed if their grade is less than 60. You need to code 2 methods: 1. The first method takes no parameters and returns an ArrayList of integers. Ask the user to enter the grades for all students. Allow the user to input as many grades as they like. The input process ends when the user enters -1, which acts as a sentinel value. The method returns these grades in the ArrayList. 2. The second method takes an ArrayList of integers as a parameter and returns an integer. Calculates and returns the number of students who failed the exam (grades less than 60). Within main function, you should use the first method to get an ArrayList of grades and use the second method to get the number of failed students. Print out the result.

Write a Java program to reverse an array. You need to create…

Write a Java program to reverse an array. You need to create 2 methods: 1. The first method takes a double array as a parameter and returns nothing. It accepts user’s inputs and puts the values into the array. 2. The second method takes a double array as a parameter and returns nothing. It prints out the array’s values in reverse. Within main function, you should declare a double array of size 5. Then use the first method to fill up the array and use the second method to print out the values in reverse.