$30
Instructions:
● Do all exercises
● Clearly print your name in the first page of your assignment
● No hand-written answers allowed
● Absolutely no late assignments
● Your assignment should be turned in to D2L
Exercise Part A (15 pts)
For each of the following (pseudo) code snippets provide the UML class diagram.
1.
public class Student { private Assignment assignment;
}
public class Assignment { private Student std;
}
(2pts)
2.
public class Disk { private List< BackupAccess > entries;
}
public class BackupAccess { private DiskShare x;
private List< Disk > disks;
}
public class DiskShare { private Disk a; private BackupAccess ba;
}
(3pts)
3.
public class AmazonAccount{ private string name; private Purchase[] entries; private Category [] ctgrs;
(5pts)
}
public class Category { private string name;
private DateTime createdDate;
}
public class Purchase{ private string name; private Category[] categories; private boolean isDeleted;
}
4. public abstract class Store { (5pts)
public void FetchStore(Article[] articles);
public abstract Article getInformation();
}
public interface Accounting { void getAccountDetails();
Account updateAccountDetails();
}
public class MSUStore extends Store implements Accounting{ private string storeLocation;
public void store(Article[] articles) { Book b = new Book(); // other code …. } public Article retrieve() { … }
}
Exercise Part B (15 pts)
Write pseudo code to describe the following UML class diagram:
Note: Different UML tools may have slight variations in notation. In this diagram, you may ignore the small filled circle at the end of arrow heads. You may also ignore the small icons next to attributes and methods.
Exercise Part C (5 pts)
Suppose we need to develop a system named ‘Retail System’. Draw a single use case diagram capturing the following 4 use cases.
i) A manager can add a new product in the system. ii) A manager can delete a product in the system. iii) A manager can edit a product information in the system.
iv) Both use cases (i), (ii) and (iii) should reuse this new use case i.e., a product should be available in the stock.