Question: Wasn't able to do this assignment because I wasnt sure how to, this is the assignment: https://imgur.com/a/R56j13m That's the assignment, which is for Java, heres
Wasn't able to do this assignment because I wasnt sure how to, this is the assignment:
https://imgur.com/a/R56j13m
That's the assignment, which is for Java, heres the code he started us out with ;
import java.util.*; public class AtoY { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[][] tbl = new char[5][5]; int row = -1, col = -1; String inp; for (int i = 0; i < 5; ++i) { inp = sc.next(); for (int j = 0; j < 5; ++j) { tbl[i][j] = inp.charAt(j); if (tbl[i][j] == 'a') { row = i; col = j; } } } if(solve(tbl, row, col, 'a')) printTable(tbl); } public static boolean solve(char[][] t, int row, int col, char c) { // You might use a method signature like this for a recursive // solution. } public static void printTable(char[][] t) { for (int i = 0; i < 5; ++i) { for (int j = 0; j < 5; ++j) System.out.print(t[i][j]); System.out.println(); } } } If you can show me what you did, how you coded this, that would be greatly appreciated, thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
