Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10}, print:
7 9 11 10
10 11 9 7
import java.util.Scanner;
public class CourseGradePrinter {public static void main (String [] args) {Scanner scnr = new Scanner(System.in);final int NUM_VALS = 4;int [] courseGrades = new int[NUM_VALS];int i;
for (i = 0; i < coursegrades.length;="" ++i)="">courseGrades[i] = scnr.nextInt();}
/* Your solution goes here */
P.S. The answer came out wrong the first try
10 11 9 7Enter
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here