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 =...


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



7 9 11 10



10 11 9 7Enter




Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here