subject

Take the 2D array of integers 'matrix' and print the tranpose matrix. // You may assume that row and column counts are equal.
// **Hint: Use printMatrix to print the result**
// e. g.
// 1 2 3 1 4 7
// 4 5 6 2 5 8
// 7 8 9 369
void transposeMatrix(int matrix[NUM_ROWS] [NUM_COLUMNS])
{
int matrix2[NUM_ROWS][NUM_COLUMNS];
// Enter code below =>
}
// Problem 6: multiplyMatrix
// Take two 2D arrays of integers 'matrixl' and 'matrix2' and print the
// resulting matrix gained by multiplying the entries in each corresponding location.
// You can assume the two matrices will have the same dimensions.
// **Hint: Use printMatrix to print the result**
// e. g.
// 1 2 3 1 2 3 1 49
// 4 5 6 4 5 6 => 16 25 36
// 7 8 9 49 64 81
void multiplyMatrix(int matrix1[NUM_ROWS] [NUM_COLUMNS], int matrix2[NUM_ROWS] [NUM_COLUMNS])
{
int matrixResult[NUM_ROWS][NUM_COLUMNS) ;
// Enter code below
}
splitAndPrintWords (5 points) // Split s[] into individual words and store them in str[][].
// Read s[] character by character and copy into str[][], such that word 1 is in str[0][],
// word 2 is in str[1][], and so on. Print the char array str[][], so that the separated words are
// printed on their own line. Finally return the number of words using the variable 'count'.
// Don't forget to initialize str[[] with the null terminator character '\0'.
// Hint: Words are separated by whitespace characters // e. g.
// "The quick brown fox jumped over the lazy dog"
// The
// quick
// brown
// fox
// jumped
// over
// the
// lazy
// dog
int splitAndPrintWords (char s[NUM_STRINGS STRING_LENGTH])
{
char str[NUM_STRINGS][STRING_LENGTH); int count = 0;
// enter code below return count;
}
// Remove all occurrences of the specified character 'filter' from s[].
// Use the resulting array as input to splitAndPrintWords.
// *** NOTE: If you were unable to code for splitAndPrintWords(), then skip this step and just filter out the char. You will earn partial points for that case.
void filterChar(char s[NUM_STRINGS * STRING_LENGTH), char filter)
{
}
int main()
{
printf("CSE240 HW3: 2D Integer Arrays\n\n");
int matrix[NUM_ROWS] [NUM_COLUMNS] =
{
{1, 2, 3, 4, 5),
{6, 7, 8, 9, 103,
{11, 12, 13, 14, 15),
{16, 17, 18, 19, 20},
{21, 22, 23, 24, 25}
};
printMatrix(matrix);
printf("\n\n");
printMatrixDiagonal(matrix);
printf("\n\n");
sumMatrixRows(matrix);
printf("\n\n");
rotateMatrixRows(matrix, 1);
printf("\n\n"); transposeMatrix(matrix);
printf("\n\n"); multiplyMatrix(matrix, matrix);
printf("\nCSE240 HW3: 2D Character Arrays\n\n");
char words[NUM_STRINGS*STRING_LENGTH);
int i = getchar();
printf("\nEnter words (max 5): ");
fgets(words, sizeof(words), stdin);
int count = splitAndPrintWords (words);
printf("\nNumber of words= %d \n", count);
filterChar(words, 'a');
i = getchar();
i = getchar();
// Keep console open
return ;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:20
Write a program called assignment3 (saved in a ļ¬le assignment3.java) that computes the greatest common divisor of two given integers. one of the oldest numerical algorithms was described by the greek mathematician, euclid, in 300 b.c. it is a simple but very eā†µective algorithm that computes the greatest common divisor of two given integers. for instance, given integers 24 and 18, the greatest common divisor is 6, because 6 is the largest integer that divides evenly into both 24 and 18. we will denote the greatest common divisor of x and y as gcd(x, y). the algorithm is based on the clever idea that the gcd(x, y) = gcd(x ! y, y) if x > = y and gcd(x, y) = gcd(x, y ! x) if x < y. the algorithm consists of a series of steps (loop iterations) where the ā€œlargerā€ integer is replaced by the diā†µerence of the larger and smaller integer. this continues until the two values are equal. that is then the gcd.
Answers: 3
question
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 22.06.2019 14:30
Create a pseudocode design to prompt a student for their student id and the titles of the three classes they want to add. the solution should display the studentā€™s id and a total bill. ā€¢ bill a student using the following rules: o students can only add up to 3 classes at a time.
Answers: 3
question
Computers and Technology, 22.06.2019 21:00
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
You know the right answer?
Take the 2D array of integers 'matrix' and print the tranpose matrix. // You may assume that row an...
Questions
question
Social Studies, 30.07.2019 11:30