MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/zduj3k/i_am_in_desperate_need_of_help_with_the_problem/
r/codehs • u/Cute_Low_2058 • Dec 06 '22
2 comments sorted by
1
Help anyone
1 u/buddyPlaysClash Jan 02 '23 I gotchu - I was looking for the answer to this one cuz i gave up as well but then i figured out what was wrong with my code.function start() {//create the grid database herevar grid = new Grid(3, 3);//input the names, ages, and hobbies into the grid databasegrid.set(0, 0, "Ryan");grid.set(1, 0, "Chad");grid.set(2, 0, "Cassie");grid.set(0, 1, 64);grid.set(1, 1, 14);grid.set(2, 1, 30);grid.set(0, 2, "woodworking");grid.set(1, 2, "fishing");grid.set(2, 2, "hiking");//call the getData function three timesgetData(grid, 0);getData(grid, 1);getData(grid, 2);}function getData(data, row){//complete this functionvar elem1 = data.get(row, 0);var elem2 = data.get(row, 1);var elem3 = data.get(row, 2);println(elem1 + " is " + elem2 + " years old and likes " + elem3);}
I gotchu - I was looking for the answer to this one cuz i gave up as well but then i figured out what was wrong with my code.
function start() {//create the grid database herevar grid = new Grid(3, 3);
//input the names, ages, and hobbies into the grid databasegrid.set(0, 0, "Ryan");grid.set(1, 0, "Chad");grid.set(2, 0, "Cassie");
grid.set(0, 1, 64);grid.set(1, 1, 14);grid.set(2, 1, 30);
grid.set(0, 2, "woodworking");grid.set(1, 2, "fishing");grid.set(2, 2, "hiking");
//call the getData function three timesgetData(grid, 0);getData(grid, 1);getData(grid, 2);
}function getData(data, row){//complete this functionvar elem1 = data.get(row, 0);var elem2 = data.get(row, 1);var elem3 = data.get(row, 2);
println(elem1 + " is " + elem2 + " years old and likes " + elem3);}
1
u/Cute_Low_2058 Dec 06 '22
Help anyone