Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Scheme program to solve the problem described above. Define a function (jobs_ok? Assignment Employees) which takes two parameters, Assignment and Employees . Assignment

Write a Scheme program to solve the problem described above. Define a function (jobs_ok? Assignment Employees) which takes two parameters, Assignment and Employees. Assignment is a list of four sub-lists, one for each shift; each sub-list contains the work assignment for that shift: 2 names for phones, followed by one for computer repair, followed by one for network repair. Employees is a list of sub-lists; each sub-list contains an employee's name, followed by three integers (1 or 0) indicating whether the employee is qualified for phones, computers, and networks, respectively. The function should return #T if the job assignment is acceptable and return #F if the job assignment is not acceptable

You may assume that the Assignment and Employees lists will be in the correct format when the function is called; you do not have to error-check for a non-list or an incorrectly formed list. In your program, you may write and call any additional functions that are helpful in the computation.

Examples:

(jobs_ok? '( (Park Dunbar Khan Lloyd) (Bashir Trivedi Ramos Franklin) (Schmidt Nakamura Andrews Chen) (Evans Goldberg Macmillan Ortiz)) '( (Andrews 1 1 1) (Bashir 1 1 1) (Chen 1 1 1) (Dunbar 1 1 1) (Evans 1 1 1) (Franklin 1 1 1) (Goldberg 1 1 1) (Jefferson 1 1 1) (Khan 1 1 1) (Lloyd 1 1 1) (Macmillan 1 1 1) (Nakamura 1 1 1) (Ortiz 1 1 1) (Park 1 1 1) (Ramos 1 1 1) (Schmidt 1 1 1) (Trivedi 1 1 1))) 

should return #T, and

(jobs_ok? '( (Young Collins Vieira Liu) (Davis Ericson Kelly Singh) (Fitzgerald Gutierrez Martinez Tortorella) (Nguyen Jones Patel Zimmerman)) '( (Aziz 1 0 0) (Blumenthal 0 1 1) (Collins 1 1 1) (Davis 1 0 0) (Ericson 1 0 0) (Fitzgerald 1 0 1) (Gutierrez 1 0 1) (Jones 1 1 1) (Kelly 0 1 1) (Liu 1 0 1) (Martinez 0 1 1) (Nguyen 1 0 0) (Patel 1 1 1) (Qureshi 1 1 0) (Rodriguez 1 0 0) (Singh 0 1 1) (Tortorella 0 0 1) (Vieira 0 1 0) (Young 0 1 0) (Zimmerman 1 1 1))) 

should return #F.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions