-------------------------------------------------------------------------- Adaptive Object-Oriented Software Development Fall 2000 COM 3360 at NU and NTU Karl Lieberherr --------------------------------------------------------------------------- Midterm --------------------------------------------------------------------------- Open book and open notes. Question 1: 15 UNKNOWNs, 3 points each: 45 points Question 2: 15 UNKNOWNs, 4 points each: 60 points Question 3: 18 UNKNOWNs, 4 points each, 72 points. Question 4: 2 UNKNOWNs, 20 points each, 40 points Question 5: 2 UNKNOWNs, 20 points each: 40 points PLEASE GIVE YOUR ANSWERS ON THIS FORM Question 1: ================================================== (below their is a choice for the part names) UNKNOWN1 = Main (CHOICE) UNKNOWN2 = List(PurchaseOrder). UNKNOWN3 = [ ObjectId ":"] (CHOICE for first) UNKNOWN4 = [ ObjectId ":"] (CHOICE for last != first) UNKNOWN5 = "" String "". UNKNOWN6 = "" Street City State Zip "". UNKNOWN7 = "" String "". UNKNOWN8 = "" String "". UNKNOWN9 = "" String "". UNKNOWN10 = "" String "". UNKNOWN11 = "" List(Order) "". UNKNOWN12 = "" Product [ Price ] "". UNKNOWN13 = "" String "". UNKNOWN14 = "" double "". (CHOICE for double, e.g. Double) UNKNOWN15 = {S}. Question 2: ================================================== UNKNOWN1 = traverse UNKNOWN2 = this UNKNOWN3 = new Visitor() UNKNOWN4 = start UNKNOWN5 = Order UNKNOWN6 = Price UNKNOWN7 = get_price (CHOICE: coordinate with part name in UNKNOWN 12 in question 1) UNKNOWN8 = EMPTY UNKNOWN9 = null UNKNOWN10 = get_price (CHOICE: coordinate with part name in UNKNOWN 14 in question 1) UNKNOWN11 = total += 1.0 UNKNOWN12 = getReturnValue UNKNOWN13 = total UNKNOWN14 = PurchaseOrders UNKNOWN15 = Order (CHOICE: e.g., Price , java.lang.String, or * but less efficient) Question 3: ================================================== Input->T T->D early termination UNKNOWN1 = R UNKNOWN2 = S successful termination UNKNOWN3 = R UNKNOWN4 = S UNKNOWN5 = T UNKNOWN6 = R UNKNOWN7 = S UNKNOWN8 = C from Input bypassing T to T early termination UNKNOWN9 = R UNKNOWN10 = S successful termination UNKNOWN11 = R UNKNOWN12 = S UNKNOWN13 = T from Input to-stop T repeat 9-13 UNKNOWN14 = R UNKNOWN15 = S UNKNOWN16 = R UNKNOWN17 = S UNKNOWN18 = T Question 4: ================================================== UNKNOWN1 = A ((R S (T R S)* C D) | (X B B* D)) UNKNOWN2 = See view graphs Question 5: ================================================== UNKNOWN1 = Exception in thread "main" edu.neu.ccs.demeter.dj.TraversalSourceException: Object graph root is class Input UNKNOWN2 = The list elements may be empty. Therefore List(S) ~ "(" {S} ")". will create an ambiguous class dictionary. Lists with 1 or 2 or 3 empty A-objects would all print as (). Because: LL(1) => not ambiguous, by contraposition we have an LL(1) violation.