Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write in C++ Page 138, Problem #7. Write a program that queries the user for the number of rows and columns of two matrices (<=10), queries the user for the values stored in each matrix,
then computes a third matrix that is the sum of the first two matrices and displays all three matrices. You must use static matrices, only filling and working with the parts
of the matrix that are needed to solve the problem.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a C program that will take a positive integer (N) andthe name of userfrom keyboard and use it to generate a matrix as follows; The size of matrix will be NxN The elements of matrix will be the name of userrepeating in columns sequentially (till all matrix elements are filled). At the end show the user's name in reversed order. Notethat, only "stdio.h" will be used as library. Example: if the inputs are entered as: N: 5 User's name: ALI Outputs must be: A I LA I L A I L A I L A I A I LA I L A I L A Reverseduser's name: ILAarrow_forwardWrite a program in C that will find the maximum number from 3 float type numbers. You have to use the function getMax which will take 3 pointer variables and return the maximum number.arrow_forwardWrite a C++ program that fills a 5 x 5 matrix of integers. The matrix must be a static matrix; its size must be fixed at compile-time. Display the contents of the matrix. Query the user for an integer. Pass the matrix and the integer to a bool function that searches for the first occurrence, and only the first occurrence, of the integer in thematrix. If the integer is found, the function returns true (and passes back the row and column coordinates of the first occurrence of the integer); if not, the function returns false. Main then displays whether the integer was found in the matrix and if so, the coordinates of the first occurrence. The use of a break to exit a loop or a function should be avoided. My code does not find the location of the first occurrence and does not use a bool function. Can you please help me to find the error. This is my code: #include <iostream> #include <random> using namespace std; int main() { int guess, array[5][5]; bool found = false; for(int…arrow_forward
- If you have a square matrix (NX N) and N is an even number like (N-8), we may divide the matrix into 4 quarters. Using C++ language write a program to swap the elements in the 1st Quarter With the elements in the 4th Quarter. In other term swap the green elements with the yellow elements. 1st Quarter 3rd Quarter 2nd Quarter 4th Quarterarrow_forwardWrite a C++ program to create a 3*3 matrix having its elements as the random values in the range [50,99] and display the matrix in the output.arrow_forwardIn C++ Query the user for the name of a file. Open and process that file, reporting the number of words in the file and the number of words containing each letter, and the length of that word. Assume that any word exceeding nine characters is counted as a ten character word. If the same letter appears more than once, it is counted only once. The result should be a matrix of 26 rows (one row for each letter) and ten columns (one column for each word length (1-10), and the contents of the matrix must be displayed. As an example, assume the file contains only two words - “rotten” and “egg”. When processing “rotten”, rows for r, o, t, e and n would have the contents of column 6 incremented because “rotten” is a six letter word. When processing “egg”, rows for e and g would have the contents of column 3 incremented because “egg” is a three letter word.arrow_forward
- Please Help. In C++. Write a program that queries the user for an odd integer n, where the permissible values for n are 3, 5, or 7. Create a 7 x 7 static matrix and use it and the rules found in the problem to produce and display an n by n magic square. Your solution for a 5 x 5 magic square must match the solution described in the text; other solutions are not acceptable.arrow_forwardQUESTION 2 Write a C++ program requesting the user to decide the size of the 2 matrices. The codes then request the user to key in the elements of these 2 matrices. The codes then calculate the multiplication of these 2 matrices and display the results. You need to make sure that the correct matrix size is being used by the user in order for the multiplication of the 2 matrices can be done.arrow_forwardChapter 4 write a program in C++ language to name a row with the name (Count) to calculate the number of inhabitants of the city of N as a function of the number of years T, noting that the primary population N is 3 million people and that the city is subject to the following population growth equation: N = Z (No + (700 -) No) exparrow_forward
- In C++: Write a function which will find the average of all elements of the sequence: {2, 4, 6, 8, 10, 12}. Use call by reference, and return the average as the function's return value.arrow_forwardWrite a c++ programarrow_forwardCreate a program using java data structures That has the user enter their pay rate; the program will require the employee to enter hours for two days ( they work two days a week); and the conversion must be done. via a recursive function (all calculation and display happen in a single function). Include an additional function to prompt the user for their numbers. Do NOT USE Stack ADT, ANY ADTs, or structures that we created in class. Employee - hoursWorked : int - payRate : double -Employee(void) Default constructor - has NO parameters and must NOT return anything. Sets both attributes to 0. -AddHours(hoursToAdd : int) : void Adds the given hours to add to the hoursWorked attribute. -SetPayRate(newPayRate : double) : void Changes the payrate attribute to the given new pay rate. -GetHoursWorked(void) : int {hoursWorked} Gives back the hoursWorked attribute -+ GetPayRate(void) : double {payRate} Gives back the payRate attribute. -GetGrossPay(void) : double {grossPay} Computes and…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education