subject

We have 3 time slots and 6 classes A, B, C, D, E, F. The following class pairs cannot be scheduled together (A, B),(A, C),(A, D),(B, E), (C, E),(C, D),(D, F),(B, F). For each class, there are three variables. For example, for class A, there are a1,a2 and a3. If a1=True this means that class A is scheduled in period 1. Write all your functions in the following parts in python. In each part, make sure that the names of your functions match the names of the functions that we are asking you to write. Note that for each part you can call functions from previous parts. There are two sets of test cases. The autograder on Gradescope will only reveal the results of one set of cases. You will not know the results of the other set of test cases. This is done to encourage you to test your own code. Required:
a. Define a function no MoreThanOnce(x1,x2,x3) that outputs True if the class X is scheduled no more than once. The first line in your code should be def noMore Than Once(x1, x2, x3)
b. Define a function at Least Once(x1,x2,x3) that outputs True if the class X is scheduled at least once. The first line in your code should be def at least once(x1, x2, x3)
c. Define a function exactlyOnce(x1,x2,x3) that outputs True if the class X is scheduled exactly once.
d. Define a function different Timeslots(x1,x2,x3,y1,72.y3) that outputs True if two classes X and Y are scheduled in different time slots.
e. Define a function is ItValid(ai, a2, a3, b1,b2, 53, c1, c2, c3, di, d2. d3, el. e2, e3, f1, f2, f3) that outputs True if the schedule is valid for classes A, B,C, D,E, and F.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:40
Convert and simplify the following sentences to conjunctive normal form (cnf): (a) (p β†’ (q β†’ r)) β†’ (p β†’ (r β†’ q)) (b) (p ∧ q) β†’ (Β¬p ↔ q) (c) ((p β†’ q) ∧ Β¬q) β†’ Β¬p
Answers: 3
question
Computers and Technology, 24.06.2019 07:30
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
question
Computers and Technology, 24.06.2019 22:30
The a great imaginary circle, or reference line, around earth that is equally distant from the two poles and divides earth into the northern and southern hemispheres.
Answers: 1
question
Computers and Technology, 25.06.2019 00:30
Which type of cell references are locked and not automatically updated when it’s copied a)formula b)relative c)absolute d)worksheet
Answers: 1
You know the right answer?
We have 3 time slots and 6 classes A, B, C, D, E, F. The following class pairs cannot be scheduled t...
Questions
Questions on the website: 13722362