Course number: CSU 670 Name: (John) Zack Ready Account name: rezn0r Name: Christopher Cahill Account name: clurin Assignment number: 3 Date: 1/27/04 ================================================== Question 1A: ================================================== modified files: constraint-checking.beh & statistics.beh (attached) output from 'demeterj test' (& also java Main < ../../statistics.input): The DJ version is: DJ version 0.8.6 The class graph is============================= end class graph ============================= check container begin begin start new container before Weight start new container before Weight start new container before Weight end container before Weight total weight 3 but limit is = 1 OVER CAPACITY end container before Weight before Weight total weight 6 but limit is = 5 OVER CAPACITY end container DONE: check container FAILURE 2 ================================================== Question 1B: ================================================== modified files: constraint-checking.beh, statistics.cd, and summingV.beh (attached) output from 'demeterj test' (& also java Main < ../../statistics.input): The DJ version is: DJ version 0.8.6 The class graph is============================= end class graph ============================= check container begin begin start new container before Weight start new container before Weight start new container before Weight end container before Weight total weight 3 but limit is = 1 OVER CAPACITY end container before Weight before Weight total weight 6 but limit is = 5 OVER CAPACITY end container DONE: check container FAILURE 2 (same as part A) ================================================== Question 2: ================================================== modified files: averageV.beh & statistics.beh output from onlyDJ-average-other-list: The DJ version is: DJ version 0.8.6 The class graph is============================= end class graph ============================= object which was read : Container ( : N ( : Item ( : Ident "apple" : Weight ( : int "6" ) ) : N ( : Item ( : Ident "orange" : Weight ( : int "9" ) ) : N ( : Item ( : Ident "kiwi" : Weight ( : int "12" ) ) done DisplayVisitor begin begin sum: add 6 count before Weight 6.0 = partial result sum: add 9 count before Weight 7.5 = partial result sum: add 12 count before Weight 9.0 = partial result done 9.0 ================================================== output from onlyDJ-average-default-list: The DJ version is: DJ version 0.8.6 The class graph is============================= end class graph ============================= object which was read : Container ( : Item_List { : Nonempty_Item_List ( : Simple ( : ItemName ( : Ident "apple" ) : Weight ( : int "12" ) ) : Nonempty_Item_List ( : Container ( : Item_List { : Nonempty_Item_List ( : Simple ( : ItemName ( : Ident "apple" ) : Weight ( : int "10" ) ) ) } : Capacity ( : int "10" ) ) : Nonempty_Item_List ( : Simple ( : ItemName ( : Ident "pear" ) : Weight ( : int "9" ) ) : Nonempty_Item_List ( : Container ( : Item_List { : Nonempty_Item_List ( : Simple ( : ItemName ( : Ident "apple" ) : Weight ( : int "8" ) ) ) } : Capacity ( : int "10" ) ) : Nonempty_Item_List ( : Simple ( : ItemName ( : Ident "kiwi" ) : Weight ( : int "6" ) ) ) ) ) ) ) } : Capacity ( done DisplayVisitor begin begin sum: add 12 count before Weight 12.0 = partial result sum: add 10 count before Weight 11.0 = partial result sum: add 9 count before Weight 10.333333 = partial result sum: add 8 count before Weight 9.75 = partial result sum: add 6 count before Weight 9.0 = partial result done 9.0 ================================================== Question 3: ================================================== Chinese Food class dictionary ChineseFoodMenu = "Food Menu:\n" List(ChineseMeal). List(ChineseMeal) ~ List(MealList) {List(MealList)}. List(MealList) ~ "Meal" Number ":\n" List(DishList) {List(SoupList)} {List(DessertList)}. Number = "1" | "2" | "3" | "4". List(DishList) ~ "" Dish {", " Dish}. Dish = "gongbao chicken" | "five flavored beef" | "tiger skin egg". List(SoupList) ~ "" Soup. Soup = "egg soup" | "three delight soup". List(DessertList) ~ "" Dessert {", " Dessert}. Dessert = "bun" | "dumpling" | "noodle".