Suppose that a company's employee data is stored in a matrix like the one in the image example: Each row of the matrix has four entries, representing the name, registration, sector, and telephone information of an employee, in that order. The number of lines depends on the number of employees. All matrix entries are in string format. Write a function that receives an array like the one in the example and performs a search by sector, that is, given a name of a sector of the company, the function returns the data of all employees of that sector. For example: searchSector(P,‘Contabilidade’) = [[‘Adalberto Ferreira’, ‘1091982’, ‘(21)99281-2983’],[‘Flavia Amorim', '1128938', '(22)99273-9404']] where P is the matrix of the image example. If no record is found, the function should return to ‘No records found’ message. Complete the exercise presented above by interacting with the user, asking have it type the array (at once or element by element), and then print a matrix with the results obtained in the search
Suppose that a company's employee data is stored in a matrix like the one in the image example:
Each row of the matrix has four entries, representing the name, registration, sector, and telephone information of an employee, in that order. The number of lines depends on the number of employees. All matrix entries are in string format. Write a function that receives an array like the one in the example and performs a search by sector, that is, given a name of a sector of the company, the function returns the data of all employees of that sector.
For example: searchSector(P,‘Contabilidade’) = [[‘Adalberto Ferreira’, ‘1091982’, ‘(21)99281-2983’],[‘Flavia
Amorim', '1128938', '(22)99273-9404']]
where P is the matrix of the image example. If no record is found, the function should return to ‘No records found’ message.
Complete the exercise presented above by interacting with the user, asking
have it type the array (at once or element by element), and then print a
matrix with the results obtained in the search.
!['(21)99281 – 2983'
'JulianaVasconcelos' '1111722' 'RecursosHumanos' '(21)99848 – 1902'
'(22)99273 – 9404'/
'AdalbertoFerreira'
'1091982'
'Contabilidade'
'Flavia Amorim'
'1128938'
'Contabilidade'](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1ad45ced-060a-492f-aea4-8cfc433400e3%2Fcf3de811-29b3-46e9-9b10-79075158386d%2F8uirai_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)