Question: I have asked this before but only gotten incomplete / non - working code. Please make sure you test the code extensively for its integrity

I have asked this before but only gotten incomplete/non-working code. Please make sure you test the code extensively for its integrity before submitting your answer. PROBLEM:
Google is interested in integrating an automated way of organizing users' schedules into its virtual assistant. The idea is that the user will tell the virtual assistant what tasks they need to complete without specifying all the exact details, and the assistant will propose a daily work schedule. Having heard good things about ASP, Google is evaluating how well it can represent user requirements in this context. The main idea is that user requirements will be translated into constraints in ASP and, along with knowledge from other Google subsystems, will be used to generate one or more feasible work schedules. You are tasked with encoding the following hypothetical usage scenario in ASP. The scenario consists of the following tasks:
On Christmas Day, I need to cook for the Christmas dinner, which will take all day.
I need to go to the supermarket for the cooking, but the earliest I can go is the day before the cooking (so the products remain fresh).
Before going to the supermarket, I need to visit the bank to withdraw money.
I also need to get a haircut before Christmas.
Since the bank, supermarket, and barbershop are close to each other but far from my house, I would ideally like to visit all three on the same day. If that is not possible, I would prefer to visit at least two of them on the same day, and as a last resort, I can visit them on separate days.
Imagine that the user dictates these tasks as they remember them. Therefore, the program must be flexible, meaning the encoding should allow some constraints to be modified while still keeping the program functional.
For example, the Christmas dinner may be moved to Christmas Eve. In that case, the constraint about the supermarket should remain unchanged because it pertains to cooking, not the day of Christmas. The virtual assistant also knows that:
It makes no sense to schedule something in the past.
Christmas Day and Christmas Eve are considered holidays.
Stores are closed on holidays, so tasks requiring a store (in this case, the supermarket, bank, and barbershop) cannot be scheduled on those days. As an exception, supermarkets are open on Christmas Eve.
Finally, the assistant knows that today is Tuesday and Christmas is on Saturday, but the program should also work for future years with different dates.
I have asked this before but only gotten

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!