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) Write a for loop to print all elements in courseGrades, following each

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!