Question
Write a C++ program that fills a 4 x 4 matrix of integers. The matrix must be a static matrix; its size must be fixed
Write a C++ program that fills a 4 x 4 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 the matrix. If the integer is found, the function returns true and passes back the row and column coordinates of the first occurrence of the integer using appropriate parameters; 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 break to exit a loop or a function should be avoid and will be penalized. Solutions that do not use a static matrix are unacceptable. Solutions that do not use a bool function as described are unacceptable.
Step 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