Final2002S - csc340 Information Systems Analysis and Design...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: csc340 Information Systems Analysis and Design page 1/ 1 2 University of Toronto Faculty of Arts and Science Department of Computer Science CSC340S - Information Systems Analysis and Design Spring 2002 John Mylopoulos April-May Examination No Aids Allowed Duration: 2 hours Make sure that your examination booklet has 12 pages (including this one). Write your answers in the space provided. This examination counts for 35% of your final mark. Name: (Please underline your last name) Student Number: Question Marks 1. ____________/15 2. ____________/15 3. ____________/15 4. ____________/20 5. ____________/10 6. ____________/25 Total ____________/100 csc340 Information Systems Analysis and Design page 2/ 1 2 The Toronto Public Libraries (hereafter TPL) is a public organization managing the 99 public libraries that operate in Metro Toronto. TPL has decided to redesign its collection material database. Currently, the database holds information on: • Books, videos and CDs available for borrowing; • Every item (book, video, CD) has a unique collection #, a title, and an ISBN# which is unique for every publication; every item may be in good order or damaged (see below); note that if there are 10 copies of a single book, they have distinct collection #s, but identical ISBN#s; • Books can be in English, or another language; in either case, the database stores the language the book is written in; • Books have a publisher and one or more authors; CDs and videos have a unique producer, and one or more artists. In addition, the database maintains data on library users and their borrowed material: • Each user has a unique userID, address, phone#; users can be adults, children or seniors; seniors can borrow material for longer periods, while children pay a nominal fine of $0.05/day for un-returned material; • When a user selects an item to be borrowed, the library clerk updates the database, recording userID, collection#, and date of borrowing; • When a user returns an item, the library clerk updates the database, recording the date when the item was returned; if the item is overdue, the clerk also collects a fine calculated as DaysLate * fine/day; the fine per day amount is $0.50, $0.05, $1.00 for seniors, children and adult users respectively; the clerk also records (in the database) the fine collected, if any; in addition, the clerk checks if the returned item is damaged, and if so, records this information (in the database, again). To add new material to the collection, TPL orders it from XYZ Co., a wholesale supplier. When it arrives, it is catalogued (i.e., an entry is added to the database) and it is made available in some library. Damaged and unused material is removed from the collection. This is done once every six months. The process consists of selecting all items that are damaged, or haven't been borrowed in the last year, and physically removing them from the collection. Note: The above description is complex, may leave details out and supply unnecessary information. You will need to make some assumptions about the problem for the parts below. MAKE SURE you write your assumptions down! csc340 Information Systems Analysis and Design page 3/ 1 2 1. [Entity-Relationship Diagrams; 15 marks] Draw an Entity-Relationship diagram that represents the information about collection materials, users and borrowings handled by the TPL database. Make sure to specify clearly the attributes of every class and relationship, as well as cardinalities and keys. Your solution should be an Entity-Relationship diagram, NOT a UML class diagram! Sample solution borrowDate collection# title ISBN publisher Book (1,N) Video author CD language (1,N) producer artist (1,N) producer artist Item (0,N) (0,N) Borrow Return returnDate (0,N) (0,N) User userID phone address Adult Child Senior csc340 Information Systems Analysis and Design page 4/ 1 2 2. [Sequence Diagrams; 15 marks] Draw a sequence diagram that describes how returned material is handled by TPL. The sequence diagram should show interactions between a user, a clerk and the TPL database during the process of having a user return a borrowed item. Make sure to show explicitly conditional interactions. Sample solution User receiveItem Clerk [damaged?] calculateCharge(item) [undamaged?] TPLDB getPurchasePrice(item) [late?] calculateFine(user) amountOwed [amount>0]pleasePay [amount>0]receive(payment) updateRecord(item,payment) thanks csc340 Information Systems Analysis and Design page 5/ 1 2 3. [State Diagrams; 15 marks] Draw up a state diagram that describes the lifetime of a collection item from the moment it is ordered by TPL until it is removed from the TPL collection. For each state, specify entry, exit, and do actions. For each transition, specify relevant events, conditions and actions. Sample solution Waiting for item to arrive Preparing Do/catalogue Exit/place in library /order arrived /makeAvailable borrowed/ updateRecord() returned On loan Available [undamaged?&onTime?] /updateRecord() returned [undamaged?&late?] /requestPayment(fine) returned &updateRecord() when(beginningOf6Months) [damaged?] [toBeRemoved?] /requestPayment(itemPrice) /updateRecord() &updateRecord() &removeItem() &removeItem() csc340 Information Systems Analysis and Design page 6/ 1 2 4. [Database Design; 20 marks] Suppose you are given the Entity-Relationship (ER) schema shown below. It describes the contents of a student database for Ontario universities. All attributes are assumed to be single-valued. In addition, you may assume that there are students who are neither undergraduate nor graduate (special students, allowed to take courses but not studying towards a degree). startYear name addr Student st# (1,1) Attends (1,N) University name city Undergrad Graduate average thesisTitle (1,2) Supervisor startDate (0,N) Professor name dept [Part a; 10 marks] Draw an ER schema that captures the same information as the diagram above, but does not have any generalization relationships. startYear name addr (0,1) hasPart t (1,1) Undergrad average Student (0,1) hasPart (1,1) Graduate (1,2) Supervisor startDate (0,N) Professor dept thesisTitle name st# (1,1) Attends (1,N) University name city csc340 Information Systems Analysis and Design page 7/ 1 2 [Part b; 10 marks] Give a relational schema that captures the same information as your ER schema of part (a). Show clearly keys for each relation in your schema. Student(st#,univName,name,addr,startDate) University(name,city) Undergrad(st#,univName,average) Graduate(st#,univName,thesisTitle) Professor(name,dept) Supervisor(st#,univName,profName,startDate) csc340 Information Systems Analysis and Design page 8/ 1 2 5. [Decision Tables; 10 marks] Assume that A, B, C are Boolean variables, X, Y, Z are outcomes. Propose a decision table for the following procedure: If A then if B then X else if C then Y else Z endIf endIf else if C then X else Z endIf endIf Make sure your final table is in simplified form, i.e., does not have redundant rows or columns. Unsimplified form A B C X Y Z T T T x T T F x T F T x x x x T F F F T T x F T F F F T x F F F Simplified form A B C X Y Z • • T T * x T F T x x x x x right T F F F * T x F * F F T F F F T x F F F 5 marks for getting the structure of the table (ie, 6 rows, 8 columns, labels) 8 marks for getting the unsimplified table right. csc340 Information Systems Analysis and Design page 9/ 1 2 6. [Short Questions; 25 marks total] [Database Design; 5 marks] Consider a relation R(A,B,C,D) with primary key A,B and functional dependency C->D. Place this relation in 3NF, or explain why it is already in 3NF. R (A , B, C ) R'(C , D ) • • -1 mark for doing R'(C,D ) 1 mark (total) for saying altogether outrageous…) something wrong (but not [Interface Design; 5 marks] Consider the design of an interface for a computer-supported 2-person game, such as chess or checkers. Assume that the game starts with the computer sending a message to userA prompting her for a move. UserA responds with a move, and the computer checks if it is a winning move. If so, the computer announces the win, else it prompts userB for a move. Again, once the move is in, the computer checks if it is a winning move and if not prompts userA for a move, etc. Draw a state diagram that describes the dialogue structure of this interface. Make sure to describe clearly events, conditions and actions associated with each transition of your diagram. start Computer checks [noWin]computerPromp() [Win]announceResult() userAquits userBmove userBquits UserB thinks [Win]announceResult() [noWin]computerPrompt() Computer checks userAmove UserA thinks • • 2.5 marks for getting states, transitions right 2.5 marks for getting events, conditions actions right csc340 Information Systems Analysis and Design page 10/ 1 2 [Software Architectures; 5 marks] Consider a software system that compiles programs written in a high-level programming language (e.g., Java) into assembly language programs. The compiler consists of four components: Lexer, Parser, Optimizer and Code Generator. The Lexer reads the input program (an ascii file) and produces a stream of word tokens which are fed into the Parser. The Parser reads in tokens and produces a stream of parse trees, one for each statement of the input program. The Optimizer processes parse trees as they become available by transforming each to another parse tree using optimizing transformations. Finally, the Code Generator takes in optimized parse trees as they become available, and produces assembly language code which is written on an output file. Define a software architecture for such a software system, using one of {pipes-and-filters, data abstraction, layered, event-driven, repository-based}. Make sure to explain and justify your choice. Pipes-and-filters Code Lexer Tokens Parser Parse tree Optimizer Parse tree Code Generator Assembly language code [User Interface Design; 5 marks] Give one example each for a feedback and a forcing function feature from the Netscape or Explorer user interface. (Netscape) Feedback: When the system is downloading a file, clouds are flashing by the big Netscape N i n the top righthand corner Forcing Function: When you are looking at a webpage, some of the icons at the top of the window are faded, indicating that the corresponding function is not available. [Database Transactions; 5 marks] Explain the difference between a database transaction and a programming language procedure. A database transaction either executes completely or not at all (i.e., is atomic). If there is a problem in the middle of the execution, all changes done by the transaction are undone and the database returns to the state it was before the transaction started executing. Of course, programming language procedures are not atomic. csc340 Information Systems Analysis and Design page 11/ 1 2 [Scratch paper] csc340 Information Systems Analysis and Design page 12/ 1 2 [Scratch paper] ...
View Full Document

Ask a homework question - tutors are online