Question: C# Arrays. Need help to write a programming code with the following requirements and example output. Do not use goto, break (except in a switch

C# Arrays. Need help to write a programming code with the following requirements and example output.
C# Arrays. Need help to write a programming code with the following
requirements and example output. Do not use goto, break (except in a
switch statement) or continue. Do not use return or Environment.Exit() Do not
use variables of type var. Do not include any commented-out code in
your submission. Remove all unnecessary using statements. . The Whistlepig Association of

Do not use goto, break (except in a switch statement) or continue. Do not use return or Environment.Exit() Do not use variables of type var. Do not include any commented-out code in your submission. Remove all unnecessary using statements. . The Whistlepig Association of America has hired ACME industries to develop a simulation to answer, once and for all, this burning question: how much wood would a woodchuck chuck if a woodchuck could chuck wood? 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. o Each column will be labeled with a number representing the day of the simulation. Then print: 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... ...in nicely formatted messages. O . Required coding features and hints 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: o Each woodchuck has a numeric designation from one to the number of woodchucks in the simulation. Use the woodchuck's number as the basis for the index. Note that you'll need to adjust the index because the first element of an array is in position 0. o Print the woodchuck's designation at the beginning of each row. o The average amount of wood chucked per woodchuck must be a float with two decimal places. Make sure the result includes fractional values. o Add horizontal and vertical lines to separate headings and woodchuck designators from the matrix. Challenge yourself. Bonus features for Homework 4.2 1. At the end of each simulation, ask the user whether they would like to run another simulation. If they do, start back at the top asking how many woodchucks, days, etc. Each simulation is numbered; print the number of the simulation as a heading for each iteration. Note: don't forget to reset the array! 2. Add a total column and a total row that sums the value of each row and column. That is, each row total shows the output of a woodchuck for all days in the simulation, and each column total shows the output of all woodchucks for one day of the simulation. 3. Add an average column and an average row that shows the average wood chucked per woodchuck across all the days in the simulation (in each row) and the average wood chucked by all woodchucks for a single day (in each column). Each row and column average must include one decimal point of precision. Make sure each one is a fractional value. 4. If you do 2, 3 or both, add vertical and horizontal lines to visually distinguish matrix detail from the total and average Sample output for Homework 4.2-full credit In the example interaction below, data typed by the user appears highlighted and in boldface. ACME Industries Rodent Sciences Division **** WOOOCHUCK WOOD CHUCKING SIMULATION V. 2.e One row per woodchuck, one column per day Enter number of woodchucks for this simulation (1-100): 12 Enter number of days for this simulation (1-10): 10 1 2 3 5 8 9 le 48 33 29 11 31 49 5 11 1 ! 2! 31 4 5 6 71 8 91 101 31 41 7 15 23 9 35 8 11 42 24 43 10 15 40 26 19 5 34 5 4 41 29 B 44 14 24 47 6 23 8 37 21 32 4 15 32 19 22 47 12 8 12 19 8 37 21 26 17 39 35 28 5 46 34 18 24 4 8 16 Se 47 42 43 35 3 22 8 16 16 35 46 34 39 Total wood chucked: Average woodchuck chuckage: 2,456 24.56 Press any key to wrap it up... Sample output for Homework 4.2 with bonus features In the example interaction below, data typed by the user appears highlighted and in boldface. ACME Industries Rodent Sciences Division WOODCHUCK WOCO OHUCKING SIMULATION V. 1.1 One row per woodchuck, one column per day Includes Bonus Features!! Enter number of woodchucks for this simulation (1-100): 10 Enter nunber of days for this simulation (1-10): SIMULATION 1: 10 woodchucks over 5 days 1 2 3 Avg Tot 47 13 15 12 34 14 32 29 147 117 96 48 32 42 145 33 11 21 31 41 51 61 71 8 91 10 3 43 2 B 12 30 23 38 36 $ se 29.4 41 1 23.4 2 19.2 26 29. 12 27.8 34 27.6 49 | 27.6 19131.0 12 26.6 2 1 18.0 8 48 21 5e 5 139 138 138 155 133 90 45 24 Avg Tot 1 27.5 25.6 20.9 31.1 24.7 275 311 247 256 2e Total wood chucked: 1,298 Average woodchuck chuckage: 25.96 To run another simulation, typer: Enter number of woodchucks for this simulation (1-100): 5 Enter number of days for this simulation (1-10): SIMULATION 2: 5 woodchucks over 7 days 1 2 3 4 5 6 7 Avg Tot &&018 11 45 15 44 22 38 24 22 28.9 202 2 11 35 12 35 32 20 26.6 186 31 34 5 9 2 5 5 15.7 ale 42 4 13 5 23 14.3 1 si 31 27 33 11 20 4 1 28.6 200 Avg 32.6 17.2 22.2 16.2 34.4 15.0 22.0 Tot ! 163 86 111 81 172 75 110 Total wood chucked: 798 Average woodchuck chuckage: 22.80 To run another simulation, type "Y": Press any key to end program.. 9

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!