Assignment#6 : Mohammed Abdul Wasay

  1. Chef is a software developer, so he has to switch between different languages sometimes. Each programming language has some features, which are represented by integers here. Currently, Chef has to use a language with two given features A and B. He has two options --- switching to a language with two features A1 and B1, or to a language with two features A2 and B2. All four features of these two languages are pairwise distinct. Tell Chef whether he can use the first language, the second language or neither of these languages (if no single language has all the required features) The first and only line of each test case contains six space-separated integers A,B,A1,B1,A2,B2. For each test case, print a single line containing the integer 1 if Chef should switch to the first language, or 2 if Chef should switch to the second language, or 0 if Chef cannot switch to either language.
  1. You have prepared four problems. The difficulty levels of the problems are A1,A2,A3,A4 respectively. A problem set comprises two problems and no two problems in a problem set should have the same difficulty level. A problem can belong to at most one problem set. Find the maximum number of problem sets you can create using the four problems. Each test case contains four space-separated integers A1, A2, A3, A4, denoting the difficulty level of four problems. For each test case, print a single line containing one integer - the maximum number of problem sets you can create using the four problems.

3.Develop a python code to check given two dates d1 and d1 , check whether d1 is less than d2 or d1 is greater than d2 or d1 is equal to d2. (Hint: overload < , > , == operators)

4. Develop python code to add, subtract, multiply and divide two distances where each distance contains two things of the format KM followed by Meters. (Example: d1 = 4km 500 m and d2 = 3 km 200 m )
  1. Develop a class called Box with attributes length, breadth, depth and define required constructor and other relevant methods. Inherit Box class to WeightBox which contains extra attribute as weight. From this extent further as ColorWeightBox which has Color as extra attribute. Develop code for entire scenario using multi-level inheritance.