Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need help printing 2D array output: code in c please For the prelab assignment, consider a role-playing game with 5 players. Each player has a
need help printing 2D array
output:
code in c please
For the prelab assignment, consider a role-playing game with 5 players. Each player has a "character" and each of these characters has 6 ability scores. Conceptually, you might think of each character as a row in a table and each ability score as a column in that table. For example, consider this table: Character Strength Dexterity Constitution Intelligence Wisdom Charisma Gurn Greyrock 20 15 20 11 14 10 Lady Destry 16 10 14 8 16 14 Mortimer Waffleglory 10 8 Thorn 13 Zerith 14 20 16 14 15 14 12 18 20 12 12 14 11 14 7 If this were Excel, it would be easy to get an average of all scores for "Gurn Greyrock) (turns out it is 15.00 in this example) just average the scores in the first row. It would also be easy to get the average strength score for the whole collection of adventurers (14.6 in this case) just average the scores in the second column. Your job is to represent this information as a 2-dimentional array in C. You can leave out the headers (like "Character", "Strength", etc.) and can also ignore the names of the characters (the first column). This means you have 5 rows and 6 columns of integer data. You might want to avoid hard-coding the number of rows and columns (maybe use symbolic constants?). Your program should print out the entire multi-dimensional array (matrix). Then, your program should calculate an average for each row (character) in your array and print that out. It should then calculate an average for each column (ability score) in your array and print that out. Remember: No global variables. The two-dimensional array that contains all of the data should be declared and initialized in main. Main() should really only declare some variables and call the functions that you define (don't try to do all of the work in main()). Here's the matrix: Row 0 : 20 15 20 11 14 10 Row 1: 16 10 14 08 16 14 Row 2: 10 15 14 12 08 18 Row 3: 13 20 12 12 14 11 ROW 4: 14 20 14 07 16 14Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started