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

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
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

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'
Transcribed Image Text:'(21)99281 – 2983' 'JulianaVasconcelos' '1111722' 'RecursosHumanos' '(21)99848 – 1902' '(22)99273 – 9404'/ 'AdalbertoFerreira' '1091982' 'Contabilidade' 'Flavia Amorim' '1128938' 'Contabilidade'
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education