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
-
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...
-
In 9.5 s a fisherman winds 2.6 m of fishing line onto a reel whose radius is 3.0 cm (assumed to be constant as an approximation). The line is being reeled in at a constant speed. Determine the...
-
When the pump in Fig P3.130 draws 220 m3/h of water at 20°C from the reservoir, the total friction head loss is 5 m. The flow discharges through a nozzle to the atmosphere Estimate the pump power...
-
If \(F(t)=30 \sin 15 t+25 \sin \omega t \mathrm{~N}\), what values of \(\omega\) lead to a combination resonance? k = 1000 N/m k = 950 N/m w 20 N s/m FIGURE P12.25 17.8 kg F(t)
-
Tomba Corporation had 300,000 common shares outstanding on January 1, 2011. On May 1, Tomba issued 30,000 shares. (1) Calculate the weighted average number of shares outstanding for the year ended...
-
An assessment of goodwill impairment is conducted by the management. The goodwill is resulted from previous mergers and acquisitions. During the impairment testing, a discounted cash flow (DCF) is...
-
Record the following petty cash transactions of Lexite Laminated Surfaces in general journal form (explanations are not required): Apr. 1 Established a petty cash fund with a $200 balance. 30 The...
-
Investors corporation has ten unrelated individual shareholders, who each own 10% of the outstanding stock. For their tax year ended December 31 of this year, Investors' gross income includes:...
-
Use the sample space shown in Figure13.5 to find the probabilities in Problems 32-39 for the experiment of rolling a pair of dice. Figure 13. 5 \(P(\) eight \(o r\) ten \()\) THE 36 WAYS DICE CAN...
-
Two cards are drawn from a standard deck of cards, and one of the two cards is noted and removed. Find the probabilities of the second card, given the information about the removed card provided in...
-
What are the purposes and the key components of an RIA?
-
What is the expectation for the \(\$ 1\) bets in Problems 21-30 on a U.S. roulette wheel? See Figure 13.8 Odd 4 16 33 1 20 14 31 9 22 18 29 28 12 35 3 26 0 32 15 19 4 21 2 25: 4 21 2 25 17 34 6 27 13...
-
Suppose that you toss a coin and roll a die in Problems 28-31. The sample space is shown in Figure13.1. Figure 13. 1 What is the probability of obtaining: a. Tails? b. Heads or a two? c. One, two,...
-
Russell Corp. manufactures computer desks in its Syracuse, New York, plant. The company uses activity-based costing to allocate all manufacturing conversion costs (direct labor and manufacturing...
-
In the figure, two loudspeakers, separated by a distance of d1 = 2.63 m, are in phase. Assume the amplitudes of the sound from the speakers are approximately the same at the position of a listener,...
-
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
-
Sketch the expectation function for the logistic growth model (12.34) for \(\theta_{1}=1, \theta_{3}=1\), and values of \(\theta_{2}=1,4,8\), respectively. Overlay these plots on the same \(x-y\)...
-
Consider the Gompertz model in Eq. (12.35). Graph the expectation function for \(\theta_{1}=1, \theta_{3}=1\), and \(\theta_{2}=\frac{1}{8}, 1,8,64\) over the range \(0 \leq x \leq 10\). Equation...
-
Consider the following observations: a. Fit the nonlinear regression model \[ y=\theta_{1} e^{\theta_{2} x}+\varepsilon \] to these data. Discuss how you obtained the starting values. b. Test for...
Study smarter with the SolutionInn App