Question: 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
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
Hint: Use two for loops. Second loop starts with i = NUM_VALS - 1. (Notes) 
1 import java.util.Scanner; 3 public class CourseGradePrinter { 4 public static void main (String args) final int NUM-VALS 4; int courseGrades = new int [NUM -VALS]; int i; courseGrades[0] = 7; courseGrades[1] = 9; courseGrades [2]- 11; courseGrades[3]-10; 10 12 13 14 15 16 17 Your solution goes here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
