Question: IN C LANGUAGE. PLEASE INCLUDE COMMENTS. THANK YOU! * Write a program that will populate a 2-d array of c-strings that will be used for
IN C LANGUAGE. PLEASE INCLUDE COMMENTS. THANK YOU!
* Write a program that will populate a 2-d array of c-strings that will be used for a classroom seating chart, print out all the strings entered in a table, and then calculate some values on the 2-d array of c-strings.
* * Your main should read in the number of rows first and then columns that are in the seating chart. The code should make sure that the number of rows or number of * columns requested is not larger than the 10x10 array and loop until * values less than 10 are entered. You should have code in the main of your program that calls and display any results from the three functions in an appropriate manner.
* * The 2d array and any other information MUST be passed to the functions. No global variables should be used.
* * The first function readNames will populate the 2d array with C-strings. The function will have arguments for the number of rows and number of columns in the 2d grid. The function will then read the strings (including whitespace) storing them in columns first.
* * The next function, printChart, prints the 2d array of c-strings nicely as a * table, making sure columns line up. Each row on the screen should correspond to each row in the seating chart.
* * * Third Function your function should return the number of names in the entire chart where name[length] is UPPERCASE AND create a 1-d array that holds the average length of the names per AVERAGE OVER COLUMNS (a 1-d array of * doubles). length will be provided by the user and should be requested to be entered in main and passed to the function. The results from the function should then be displayed by main
void readNames(char myChart[10][10][15], int numRows, int numCols) {
// place code for readNames here
}
void printChart(char myChart[10][10][15], int numRows, int numCols) {
// place code for printChart here
}
int thirdFunction(char myChart[10][10][15], int numRows, int numCols, int length, double values[10]) {
// place code for third function here, description for PART1 // and PART 2 above will be // posted on the board during your assigned lab period } int main() { char ourRoom[10][10][15]; // largest chart we will need double results[10]; // for thirdFunction results // place code here for your header // place code here for reading in number rows, number columns, and // code that makes sure the rows and columns are always less than 10 and // also code that calls your three functions appropriately return 0; } Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
