Create a simple program that asks the user for a row and column size for a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a simple program that asks the user for a row and column size for a 2-D integer array, then have The program create such an array. At this point this array's cells should be filled with zeros since nothing has been done to change the cell values. Next, have that program dynamically adapt to the sizes of the array (that were provided by the user) and fill the array with numbers ascending from 1 n (n being the number of the nth cell in that 2-D Array depending on the size). Please then print the array out. Remember, you cannot just print an array out, you have to use loops and print each cell individually. Please refer to the sample output below for visualization and match its style. As always: Remember, the class name should be Lab8B. The user input is indicated in bold. Sample Output #1: Please enter the number of rows: 4 Please enter the number of columns: 4 I have 4 rows and 4 columns. I need to fill-up 16 spaces. The 4x4 array: 1|2|3|41 51617181 9|10|11|12| 13 | 14 | 15 | 16 | Sample Output #2: Please enter the number of rows: 3 Please enter the number of columns: 2 I have 3 rows and 2 columns. I need to fill-up 6 spaces. The 3x2 array: 1|2| 3141 5161 Create a simple program that asks the user for a row and column size for a 2-D integer array, then have The program create such an array. At this point this array's cells should be filled with zeros since nothing has been done to change the cell values. Next, have that program dynamically adapt to the sizes of the array (that were provided by the user) and fill the array with numbers ascending from 1 n (n being the number of the nth cell in that 2-D Array depending on the size). Please then print the array out. Remember, you cannot just print an array out, you have to use loops and print each cell individually. Please refer to the sample output below for visualization and match its style. As always: Remember, the class name should be Lab8B. The user input is indicated in bold. Sample Output #1: Please enter the number of rows: 4 Please enter the number of columns: 4 I have 4 rows and 4 columns. I need to fill-up 16 spaces. The 4x4 array: 1|2|3|41 51617181 9|10|11|12| 13 | 14 | 15 | 16 | Sample Output #2: Please enter the number of rows: 3 Please enter the number of columns: 2 I have 3 rows and 2 columns. I need to fill-up 6 spaces. The 3x2 array: 1|2| 3141 5161
Expert Answer:
Answer rating: 100% (QA)
Code import javautilScanner public class Lab8B public static void mainS... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Evaluate lim 2x. 2 12 2 4 The limit does not exist.
-
What is a branch delay slot and why does it arise? [7 marks] How can branch delays be avoided? If a processor exhibited one branch delay slot how would you reorder (and possibly modify) the...
-
cck3 java help them all If a processor exhibited one branch delay slot how would you reorder (and possibly modify) the instructions in the following loop to gain a performance advantage? loop ldr...
-
Plainbank has $10 million in cash and equivalents, $30 million in loans, and $15 in core deposits. a. Calculate the financing gap. b. What is the financing requirement? c. How can the financing gap...
-
Describe the additional complications facing an MNC compared with a domestic corporation when it is evaluating a capital budgeting project.
-
Ticket Sales The normal costs of a spectator ticket to the four-day international weightlifting tournament is $10 per day. It is estimated that you will achieve the following spectator numbers: Day...
-
What is the formula for calculating debt ratio?
-
The Palm Garden Greenhouse specializes in raising carnations that are sold to florists. Carnations are sold for $3.00 per dozen; the cost of growing the carnations and distributing them to the...
-
1. Create exploratory plots of the data by looking at the relationship between log(Count 1) (the response variable) and a few of the explanatory variables. Comment on any general relationships you...
-
On January 1, 2021, Gundy Enterprises purchases an office for $360,000, paying $60,000 down and borrowing the remaining $300,000, signing a 7%, 10-year mortgage. Installment payments of $3,483.25 are...
-
A solid sphere of radius 40.0 cm has a total positive charge of 10.0 nC uniformly distributed through its volume. Calculate the magnitude of the electric field 30.0 cm from the center of the sphere...
-
WHY is Rent Revenue accounted for under Other Income and Expense on the Income Statement?
-
What is the lamina propria and where is it located? Given thathigh number of eosinphils i the lamina propria suggests an allergicreaction, how might that lead to intestinal problems?
-
Great National Limited (GNL), is a multinational company with diverse product ranges and operating in many geographical markets. GNL is finalizing its financial statements for the year ended 30...
-
2. [3 pt] Solve the following recursion exactly by drawing a recursion tree. (You will need to give an exact explicit solution for 7). T(n) = T +T 1 (1/3)+ +n
-
Your client, the Washington Unicorns, is in negotiation with Jordy Michaels for the contract that will cover the final season of his amazing basketball career. Michaels was reasonably healthy last...
-
Would it be a CCPC or a public company? How do we decide? If A and B incorporate company C for a new project and each of them has 50% voting shares and equally contribute to the company, then what...
-
Chapter 9 Stock Valuation at Ragan Engines Input area: Shares owned by each sibling Ragan EPS Dividend to each sibling Ragan ROE Ragan required return Blue Ribband Motors Corp. Bon Voyage Marine,...
-
Write nested loops to draw this pattern: * ** **. **
-
This standard library function returns a random integer within a specified range of values. a. Random b. Randint c. Random_integer d. Uniform
-
The showinfo function is in this module. a. Tkinter b. Tkinfo c. Sys d. Tkinter.messagebox
-
Explain the following terms and their relevance to debt-finance decision makers: (a) Negative covenant. (b) Conversion premium. (c) Collateral. (d) Strip bonds. (e) Sukuk.
-
Flying High plc plans to expand rapidly over the next five years and is considering the following forms of finance to support that expansion. (a) A five-year 10 million floating-rate term loan from...
-
Convertibles are great because they offer a lower return than straight debt and we just dish out shares rather than have to find cash to redeem the bonds executive at Myopic plc. Comment on this...
Study smarter with the SolutionInn App