Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.util.Scanner; public class PoD { /** * ====Method for you to complete==== * This method will receive a number from 0 to 99 along

image text in transcribedimage text in transcribedimage text in transcribed

import java.util.Scanner;

public class PoD {

/** * ====Method for you to complete==== * This method will receive a number from 0 to 99 along with an integer array. * The tens-digit of the number provided will represent the row, the ones-digit * will represent the column. The integer in the designated row/column * will be increased by one. (e.g. if you receive the number 24, you will * increase the integer found in row 2, column 4 of the array by 1) * @param number Integer two digit number * (first digit = row to add to; second digit = column to add to) * @param array Array to modify * @return void */

static void increaseCellByOne(int number, int[][] array) { //START WORK HERE

//END WORK HERE }

public static void main(String[] args) {

//INPUT Scanner in = new Scanner(System.in); int[][] table = new int[10][10]; int numberUpdates = in.nextInt(); for (int i=0; i

for (int r=0; r

}

}

Instructions Today you are going to finish off a method described below. Your work isn't wasted... maybe you could make use of this one in your assignment? (It's STILL due this coming Sunday! Details of increaseCellByOne () method *B lethod for you to complete * This method will receive a number from 0 to 99 along with an integer array. * The tens-digit of the number provided will represent the row, the ones-digit * will represent the column. The integer in the designated row/column * will be increased by one. (eg. if you receive the number 24, you will * increase the integer found in row 2, column 4 of the array by 1) * @param number Integer two digit number (first digit = row to add to: second digit = column to add to) * @param array Integer array to modify * @return void */ Input: Parameters The method will take the following parameters: an integer (number): Two digit number (between 0 and 99) an integer array(array): A 10x10 array of integers, Processing Determine which ROW you are going to update. The row will be whatever is in the tens-digit of the integer variable number Eg. If number equals 24, you would want to use row index 2. Determine which COLUMN you are going to update. The row will be whatever is in the ones-digit of the integer variable number Eg. If the number equals 24, you would want to use column index 4. Increase the integer found in the ROW/COLUMN cell of the array (array) by 1. Output: Return value The method does not return anything. (All program output, from the main method, is handled for you.) Sample method Input/output: increaseCellByOne() Input arguments table array before entering method table array after leaving method 24, table 0 1 2 3 4 5 6 7 8 9 1 o o o o o o o o o 2 4 ooooooooo 5 7 o o o o o o ooo 9 0 1 2 3 4 5 6 7 8 9 1 o o o o o o o o o 2 1 4 o oooooooo 5 7 o o o o o o ooo 9 39, table 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 import java.util.Scanner; 8. public class POD { * ====Method for you to complete==== * This method will receive a number from 0 to 99 along with an integer array. * The tens-digit of the number provided will represent the row, the ones-digit * will represent the column. The integer in the designated row/column * will be increased by one. (e.g. if you receive the number 24, you will * increase the integer found in row 2, column 4 of the array by 1) * @param number Integer two digit number (first digit = row to add to; second digit = column to add to) * @param array Array to modify * @return void static void increaseCellByOne(int number, //START WORK HERE int[][] array) { //END WORK HERE public static void main(String[] args) { //INPUT Scanner in = new Scanner(System.in); int[][] table = new int[10][10]; int number Updates = in.nextInt(); for (int i=0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

What types of nonverbal behavior have scholars identifi ed?

Answered: 1 week ago