Question: Hello Can someone please walk through this problem with as much explanation as possible. Thanks you- import java.io.*; import java.util.Scanner; class Lesson_33_Activity_One { public static

Hello Can someone please walk through this problem with as much explanation as possible. Thanks you-

import java.io.*; import java.util.Scanner; class Lesson_33_Activity_One { public static void upper(String [] a) { //Use a for loop to process each index in an array for(int i = 0; i < a.length; i++) { //At each i, change the ith string to uppercase by storing //the results of a[i].toUpperCase() in a[i]. a[i] = a[i].toUpperCase(); } } //main method to test the program. This is not required by the code-runner, //but is an important step in writing new methods. public static void main(String [] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter a positive number indicating the length of an array:"); int n = scan.nextInt(); String [] a = new String [n]; for(int i = 0; i < n; i++) { System.out.println("Enter a String:"); a[i] = scan.next(); } System.out.println("Calling upper() on the values you entered changes the array to the following:"); upper(a); for(int i = 0; i < a.length; i++) System.out.println(a[i]); } }

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!