Assignment 4 Answers April 5, Cyclomatic complexity Either of these two representations is correct (simple sequences can be collapsed to a single node). CC = #edges - #nodes +2 = =2 CC = #edges - #nodes +2 = =2 4 marks Total of 27 marks
Assignment 4 Answers April 5, WMC, using technique a), is the number of methods in a class: SalesLineItem2 ProductSpecification4 Sale6 3. LCOM, using technique a) for each attribute calculate: #methods using the class number of attributes then calculate the average of those values; convert the average to a percentage; subtract that from 100: SalesLineItem (two methods and two attributes) average of 2/2 and 2/2 is 1 ==> 100% ==> = 0 ProductSpecification (four methods and three attributes) average of 2/4, 2/4, and 2/4 is 0.5 ==> 50% ==> = 50 3 marks 4 marks
Assignment 4 Answers April 5, An O-R mapping: ClassMaps to Relation Sale SalesLineItem AssociationMaps to Relation/FKey containsFK in SalesLineItem (refers to Sale) describesFK in SalesLineItem (refers to ProductSpecification) ProductSpecification SalesLineItem Sale 16 marks
Assignment 4 Answers April 5, 2002 Relational Schema Sale ProductSpecification SalesLineItem dateisComplete... quantitysOID descriptionpriceitemID sOID slOID pOID
Assignment 4 Answers April 5, 2002 Rows: Sale ProductSpecification SalesLineItem dateisComplete... quantitysOID descriptionpriceitemID sOID slOID pOID 4/5/2002false Product 1$