Question: C# question two-dimensional matrix The simulator will produce a two-dimensional matrix. Each column represents one day of chucking wood. Each row represents one woodchuck. Each

C# question two-dimensional matrix

The simulator will produce a two-dimensional matrix. Each column represents one day of chucking wood. Each row represents one woodchuck. Each cell in the matrix, then, holds the number of pieces of wood chucked by an individual woodchuck on a specific day. The simulator is to work as follows:

- Display a nice banner explaining the simulation in brief.

- Ask the user how many woodchucks to simulate (1 to 100).

- Ask the user how many days to simulate (1 - 10).

- Using the random number generator in the Random class, populate each cell with a value between 1 and 50 (inclusive) that represents the number of pieces of wood chucked by the specific woodchuck on that specific day.

- Print the matrix.

Each row will be labeled with a woodchuck designator: a number between 1 and the number of woodchucks in the simulation.

Each column will be labeled with a number representing the day of the simulation.

- Then print:

1. The total number of pieces of wood chucked across the simulation, and o The average number of pieces of wood chucked per day per woodchuck

2.in nicely formatted messages.

Required:

Use constants for the maximum number of woodchucks and the maximum number of days.

Ensure that the user types in positive whole numbers for number of woodchucks and number of days using TryParse and a validation loop.

Use the Random class to calculate the integer value of each cell.

Use at least one foreach. Hint: you might want to use foreach to total all the values in the array.

Use a two-dimensional array to represent how much wood a woodchuck chucks each day.

Output formatting:

Each woodchuck has a numeric designation from one to the number of woodchucks in the simulation. Use the woodchucks number as the basis for the index. Note that youll need to adjust the index because the first element of an array is in position 0.

Print the woodchucks designation at the beginning of each row.

The average amount of wood chucked per woodchuck must be a float with two decimal places. Make sure the result includes fractional values.

Add horizontal and vertical lines to separate headings and woodchuck designators from the matrix.

C# question two-dimensional matrix The simulator will produce a two-dimensional matrix. Each

In the example interaction below, data typed by the user appears highlighted and in boldface. ***************** ACME Industries Rodent Sciences Division ***************** * WOODCHUCK WOOD CHUCKING SIMULATION V. 2.0 * One row per woodchuck, one column per day * **************************************************************************** Enter number of woodchucks for this simulation (1-100): Enter number of days for this simulation (1-10): 10 10 1 2 3 4 5 6 7 8 9 10 41 29 8 34 49 17 29 1 | 21 3 41 5 6 7 8 91 31 41 7 15 23 9 35 8 11 42 24 43 10 15 40 26 19 5 34 44 14 24 47 29 11 31 44 35 28 30 3 22 43 37 21 32 4 15 32 19 22 47 12 8 12 19 8 37 21 26 17 39 4 48 9 24 4 8 16 50 47 42 43 40 11 35 24 16 35 11 6 47 8 16 13 16 33 44 5 46 34 18 14 46 34 39 23 8 101 Total wood chucked: Average woodchuck chuckage: 2,456 24.56 Press any key to wrap it up

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!