Question
In this question the aim is to store Integer objects alongside LinkedList objects. (a) One solution is to use ArrayList, since all Java objects extend
In this question the aim is to store Integer objects alongside LinkedList objects. (a) One solution is to use ArrayList, since all Java objects extend Object. Explain why this is bad practice. [2 marks] (b) Seeking to provide a solution that allows an arbitrary set of constrained types, a programmer writes an abstract ConstrainedArray base class. To use it, the class is extended and a specialised void add(...) method should be provided for each acceptable type. public abstract class ConstrainedArray { protected ArrayList mArray = new ArrayList(); public Object get(int idx) {return mArray.get(idx);} public int size() { return mArray.size(); } } (i) Show how to a class IntListArray that extends this base class and accepts only Integer or LinkedList objects. Where appropriate, objects should be copied on insertion. [4 marks] Define a polymorphic datatype 'a ltree to represent lazy binary trees. [3 marks] (e) Define a function inorder of type 'a ltree -> 'a seq that traverses a lazy tree in-order, returning the nodes in a lazy list. (You should define any auxiliary functions you may use.) [5 marks] 10 CST.2004.13.11 11 Natural Language Processing (a) Give brief definitions of the following terms: (i) referring expression; (ii) cataphora; (iii) pleonastic pronoun. [6 marks] (b) Describe the Lappin and Leass algorithm for pronoun resolution, illustrating its operation on the text below. Exact weights for salience factors are not required. Owners love the new hybrid cars. 2. o The case will be referred to the Head of the School of ICT for consideration of further action. Julian Dermoudy, August 21st 2022.odern work area and server processors support concurrent multithreading (additionally called hyperthreading). At the point when will there be an exhibition benefit in booking two non-intelligent applications on the equivalent hyperthreaded processor center so they run in equal as opposed to running consecutively, one work one after the other? Using the qualities of the organization portrayed above,You are expected to plan a geography revelation convention for an organization of exchanging hubs interconnected by joins. There are n hubs, l connections, the 9/9 MAKE well-designed Web page that incorporates the main UXD design theories, principles, and practices. As part of the development, issues such as search, and navigation, facilities should be addressed. 1. Relate the main theories and principles of user experience design to build effective and relevant interactions by users with computer systems 2. Execute the leading practices of user interface design to produce well-designed and appealing interfaces that allow users to have efficient and satisfying interactions with computer systems Objects: Electronic health records (EHRs) in a nationwide service. Policy: The owner (patient) may read from its own EHR. A qualified and employed doctor may read and write the EHR of a patient registered with him/her. (iv) Object: The solution to online coursework. Policy: The coursework setter has read and access. A candidate has no access until after the marks have been published. [8 marks each] Describe a sequence of events that would allow external modification of an object stored within an IntListArray, despite correct copying on insertion. How could this be addressed in IntListArray? [3 marks] (iii) By adding protected void add(Object o) {mArray.add(o);} to the ConstrainedArray class, the mArray field can be made private. Show how this would affect your IntListArray class and discuss the advantages of the change from protected to private. [5 marks] What is the goal of software design? What would be different if developers went straight to coding without adhering to software design principles?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started