Database System Concepts 7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
1 Introduction 2 Introduction To The Relational Model 3 Introduction To Sql 4 Intermediate Sql 5 Advanced Sql 6 Database Design Using The E-r Model 7 Relational Database Design 8 Complex Data Types 9 Application Development 10 Big Data 11 Data Analytics 12 Physical Storage Systems 13 Data Storage Structures 14 Indexing 15 Query Processing 16 Query Optimization 17 Transactions 18 Concurrency Control 19 Recovery System 20 Database-system Architectures 21 Parallel And Distributed Storage 22 Parallel And Distributed Query Processing 23 Parallel And Distributed Transaction Processing 24 Advanced Indexing Techniques 25 Advanced Application Development 26 Blockchain Databases Chapter1: Introduction
Chapter Questions Section: Chapter Questions
Problem 1PE Problem 2PE: List five ways in which the type declaration system of a language such as Java or C++ differs from... Problem 3PE Problem 4PE Problem 5PE: Keyword queries used in web search are quite different from database queries. List key differences... Problem 6E Problem 7E Problem 8E Problem 9E Problem 10E Problem 11E Problem 12E Problem 13E Problem 14E Problem 15E Problem 1PE
Related questions
C programming
Input code in "Enter code here" section
Transcribed Image Text: #include <stdio.h>
void matrix_printer( ... ){
printf("MatrixA \t MatrixB\n");
// Enter code here
printf("\n");
void matrix_operation( ... ){
printf("\nResult\n");
// Enter code here
}
int main(){
int matrixA[4][4];
int matrixB[4][4];
char operator;
// Enter code here
printf("\n");
getchar();
matrix_printer (matrixA, matrixB);
printf("Enter operator (+, -): ");
do{
scanf ( "%c", &operator);
}while(operator != '+' && operator != '-');
matrix_operation(matrixA, matrixB, operator);
return 0;
Transcribed Image Text: Print the summed or subtracted result of the 4x4 2D array. An
operator (+ or -) MUST be inputted by user.
Also, each elements of matrix MUST be inputted by user.
Example)
>123 4 5 6 7 8 9 10 11 12 13 14 15 16
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
MatrixA
MatrixB
123 4
16 15 14 13
12 11 10 9
8765
4 321
5678
9 10 11 12
13 14 15 16
Enter operator(+, -): +
Result
17 17 17 17
17 17 17 17
17 17 17 17
17 17 17 17
>123 4 5 67 8 9 10 11 12 13 14 15 16
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
MatrixA
MatrixB
123 4
5 678
9 10 11 12
16 15 14 13
12 11 10 9
8765
13 14 15 16
4321
Enter operator(+, -): -
Result
-15 -13 -11 -9
-7 -5 -3 -1
1357
9 11 13 15
Process by which instructions are given to a computer, software program, or application using code.
Expert Solution
Approach
Function matrix_printer
void matrix_printer(int matrixA[][4], int matrixB[][4]) { printf("MatrixA \t MatrixB\n"); for (int c = 0; c < 4; c++) { for (int d = 0 ; d < 4; d++) {
//print matrixA elements printf("%d ", matrixA[c][d]); } printf("\t"); for (int e = 0 ; e < 4; e++) {
//print matrixB elements printf("%d ", matrixB[c][e]); } printf("\n"); } printf("\n"); }
Function matrix_operation
void matrix_operation(int matrixA[][4], int matrixB[][4], char operator) { printf("\nResult\n"); int matrixC[4][4]; int c,d; if (operator == '+') //check if operator is '+' { for (c = 0; c < 4; c++) { for (d = 0 ; d < 4; d++) { matrixC[c][d] = matrixA[c][d] + matrixB[c][d]; //perform addition printf("%d ", matrixC[c][d]); //print result } printf("\n"); } } if (operator == '-') //check if operator is '-' { for (c = 0; c < 4; c++) { for (d = 0 ; d < 4; d++) { matrixC[c][d] = matrixA[c][d] - matrixB[c][d]; //perform subtraction printf("%d ", matrixC[c][d]); //print result } printf("\n"); } } }
Step by step
Solved in 2 steps with 2 images
UNLOCK THE REST