Unit 6_ Lesson 5 - Coding Activity 1
Unit 6_ Lesson 5 - Coding Activity 1
Instructions
Debug the reverse method code in the U6_L5_Activity_One class, which is intended to print
each String from a parameter array backwards on a new line. Unlike the reverse method you
wrote in lesson 3, this method uses an enhanced for loop to iterate through the array.
Use the runner class to test this method: do not add a main method to your code in the
U6_L5_Activity_One.java file or it will not be scored correctly.
Enter values:
hill
mold
tree
lake
llih
dlom
eert
ekal
https://courses.projectstem.org/courses/166695/assignments/19187337?module_item_id=36946628 1/2
3/29/25, 12:33 PM Unit 6: Lesson 5 - Coding Activity 1
STATUS
RESET SAVE
INSTRUCTIONS RUN CODE GRADING HISTORY
1 public class U6_L5_Activity_One
2 {
U6_L5_Activity_One.java 3 RUN CODE CL
4 public static void reverse(String[] wo
5 {
runner_U6_L5_Activity_… 6 for(String s ; words)
7 { ERROR
8 for(int i = words[s].length() - 1;
9 { /tmp/sub-
10 System.out.print(words.substring
11 } 3585268801/U6_L5_Activity_
12 System.out.println(); error: ';' expected
13 } for(String s ; words)
14 }
15 ^
16 } 1 error
https://courses.projectstem.org/courses/166695/assignments/19187337?module_item_id=36946628 2/2