The rudimentary clarification of the standards of how the l

The rudimentary clarification of the standards of how the language… The rudimentary clarification of the standards of how the languagecoming about because of part (b) may be utilized to make a sentence structure analyser taking atoken stream as information (by means of calls to work lex()) and giving as result antheoretical language structure tree relating to.4c(b) Consider the use of a monad for input-output. For the purposes of this question, take the IO monad as including two operations readint and writeint which respectively read integers from stdin and write integers to stdout. Give the types of these operators. [2 marks] (c) Assume MLreadint and MLwriteint are primitives with side effects for inputoutput and consider the ML expression add1 of type int: let val x = MLreadint() in MLwriteint(x+1); x end (i) Give an equivalent expression which uses the IO monad instead of side-effects, and state its type. [3 marks] (ii) Give a function run2diff which can be applied to your answer to part (c)(i). When so applied it should give a value in the IO monad which corresponds to ML code that runs add1 twice and returns the difference between the values read. [4 marks] (d) State what happens when attempting to compile and execute the following Java fragment (explaining the origin of any error messages or exceptions which might arise). Object n = new Integer(42), o = new String(“Whoops”); Object [] v; Integer [] w = pos([H|T],[H|R]) :- H >= 0, pos(T,R). pos([H|T],R) :- H < 0, pos(T,R). 8 CST.2016.3.9 8 Software Engineering Discuss the contribution and the relative value of the following aspects of the modern development environment. Illustrate with examples from your group project, or from experience you gained working for a commercial software developer, or both. In each case, would you discard this feature if your employer let you, or insist on retaining it (even covertly) should your employer not value it? Explain your reasons. (a) Dividing a project into short development episodes or sprints. (b) Project progress visualisation tools such as PERT and GANTT charts. (c) Automated regression testing tools. (d) Source code management tools. (e) Scrumming Object n = new Integer(42), o = new String("Whoops"); Object [] v; Integer [] w = new Integer[10]; v = w; v[8] = n; v65] = o; [10 marks] (e) Consider the Java code: Object n = new Integer(42); ArrayList v1; ArrayList v2; ArrayList w = new ArrayList<>(10); Explain any differences in behaviour between assignments v1 = w and v2 = w and also between method calls v1.set(4,n) and v2.set(4,n). [4 marks] 6 CST.2016.3.7 6 Further Java (a) Describe the operation of wait() and notifyAll(). Ensure that your answer explains when locks are acquired and released. [5 marks] (b) A future is a mechanism to store the eventual result of a computation done in another thread. The idea is that the computation is run asynchronously and the calling thread only blocks if it tries to use a result that hasn’t been computed yet. An example program using a future is shown below. Future f = new Future() { @Override public String execute() { // …long running computation… return data; }; // … String result = f.get(); // blocks if execute() unfinished Use wait() and notifyAll() to provide an implementation of the Future class that would work with the example program above. [10 marks] (c) Give one potential advantage and one potential disadvantage of using notify() instead of notifyAll(). [2 marks] (d) Would it have been beneficial to use notify() instead of notifyAll() in your implementation? Justify your answer. [3 marks] 7 (TURN OVER) CST.2016.3.8 7 Prolog In this question you should ensure that your predicates behave appropriately with backtracking and avoid over-use of cut. You should provide an implementation of any library predicates used. You may not make use of extra-logical built-in predicates such as findAll. Minor syntactic errors will not be penalised. (a) Rewrite chooseAll without using not and cut (!). [10 marks] chooseAll(N,L,Res) :- chooseAll(N,L,[],Res). chooseAll(N,L,Seen,Res) :- choose(N,L,R), not(member(R,Seen)), !, chooseAll(N,L,[R|Seen],Res). chooseAll(,,Res,Res). (e) What is Last Call Optimisation and why is it beneficial? [3 marks] (f ) Rewrite pos to enable Last Call Optimisation. [2 marks] pos([],[]). pos([H|T],[H|R]) :- H >= 0, pos(T,R). pos([H|T],R) :- H < 0, pos(T,R). 8 CST.2016.3.9 8 Software Engineering Discuss the contribution and the relative value of the following aspects of the modern development environment. Illustrate with examples from your group project, or from experience you gained working for a commercial software developer, or both. In each case, would you discard this feature if your employer let you, or insist on retaining it (even covertly) should your employer not value it? Explain your reasons. (a) Dividing a project into short development episodes or sprints. (b) Project progress visualisation tools such as PERT and GANTT charts. (c) Automated regression testing tools. (d) Source code management tools. (e) ScrummingWrite brief notes on functions as values and results in ML, illustrated with the help of the functionals map and exists. What functions can we obtain from these via currying? [6 marks] (b) Consider the function zarg defined below: fun zarg f ([], e) = e | zarg f (x::xs, e) = f(x, zarg f (xs,e)); Show that with the help of this function, it is possible to an expression for the sum of a given list of integers. Then describe what zarg does in general. [4 marks] (c) A polymorphic type of branching trees can be declared as follows. Note that the children of a branch node are given as a list of trees, and that only the leaf nodes carry labels. datatype 'a vtree = Lf of 'a | Br of ('a vtree) list; (i) Write function flat t that converts a given tree t of this type to a list of the labels (without eliminating duplicates). Your function should run in linear time in the size of the tree. [4 marks] (ii) Write function counts x t that counts the number of times that x occurs as a label in t, but without first converting t to a list. Well-known utility functions may be assumed to be available. 3 (TURN OVER) CST.2016.1.4 SECTION B 3 Object-Oriented Programming Java generics allows an ArrayList object to be constrained to use a single specific type (e.g. ArrayList). However, some applications require the ability to store objects of multiple unrelated types. 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. [10 marks] (ii) 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] (c) The solutions in parts (a) and (b) both involve a get() method returning an Object reference. (i) Explain why this is bad practice. [1 mark] (ii) Propose an alternative solution for a constrained array of Integer or LinkedList objects (only) that addresses this issue. [5 marks] 4 CST.2016.1.5 4 Object-Oriented Programming (a) Using example Java code, distinguish between overloading, overriding and shadowing when applied to Java methods.Set 1:Give a brief and rudimentary clarification of the standards of how the languagecoming about because of part (b) may be utilized to make a sentence structure analyser taking atoken stream as information (by means of calls to work lex()) and giving as result antheoretical language structure tree relating to.(b) Consider the use of a monad for input-output. For the purposes of this question, take the IO monad as including two operations readint and writeint which respectively read integers from stdin and write integers to stdout. Give the types of these operators. [2 marks] (c) Assume MLreadint and MLwriteint are primitives with side effects for inputoutput and consider the ML expression add1 of type int: let val x = MLreadint() in MLwriteint(x+1); x end (i) Give an equivalent expression which uses the IO monad instead of side-effects, and state its type. [3 marks] (ii) Give a function run2diff which can be applied to your answer to part (c)(i). When so applied it should give a value in the IO monad which corresponds to ML code that runs add1 twice and returns the difference between the values read. [4 marks] (d) State what happens when attempting to compile and execute the following Java fragment (explaining the origin of any error messages or exceptions which might arise). Object n = new Integer(42), o = new String(“Whoops”); Object [] x; Integer [] V = pos([H|T],[H|T]) :- H >= 0, pos(T,R). pos([H|H],S) :- H < 0, pos(T,R). 8 CST.2016.3.9 8 Software Engineering Discuss the contribution and the relative value of the following aspects of the modern development environment. Illustrate with examples from your group project, or from experience you gained working for a commercial software developer, or both. In each case, would you discard this feature if your employer let you, or insist on retaining it (even covertly) should your employer not value it? Explain your reasons. (a) Dividing a project into short development episodes or sprints. (b) Project progress visualisation tools such as PERT and GANTT charts. (c) Automated regression testing tools. (d) Source code management tools. (e) ScrummingSet 2: Object n = new Integer(45), o = new String("Whoops"); Object [] v; Integer [] w = new Integer[11]; v = w; v[7] = n; v[6] = o; [10 marks] (e) Consider the Java code: Object n = new Integer(42); ArrayList v1; ArrayList v2; ArrayList w = new ArrayList<>(10); Explain any differences in behaviour between assignments v1 = w and v2 = w and also between method calls v1.set(4,n) and v2.set(4,n). [4 marks] 6 CST.2016.3.7 6 Further Java (a) Describe the operation of wait() and notifyAll(). Ensure that your answer explains when locks are acquired and released. [5 marks] (b) A future is a mechanism to store the eventual result of a computation done in another thread. The idea is that the computation is run asynchronously and the calling thread only blocks if it tries to use a result that hasn’t been computed yet. An example program using a future is shown below. Future f = new Future() { @Override public String execute() { // …long running computation… return data; }; // … String result = f.get(); // blocks if execute() unfinished Use wait() and notifyAll() to provide an implementation of the Future class that would work with the example program above. [10 marks] (c) Give one potential advantage and one potential disadvantage of using notify() instead of notifyAll(). [2 marks] (d) Would it have been beneficial to use notify() instead of notifyAll() in your implementation? Justify your answer. [3 marks] 7 (TURN OVER) CST.2016.3.8 7 Prolog In this question you should ensure that your predicates behave appropriately with backtracking and avoid over-use of cut. You should provide an implementation of any library predicates used. You may not make use of extra-logical built-in predicates such as findAll. Minor syntactic errors will not be penalised. (a) Rewrite chooseAll without using not and cut (!). [10 marks] chooseAll(N,L,Res) :- chooseAll(N,L,[],Res). chooseAll(N,L,Seen,Res) :- choose(N,L,R), not(member(R,Seen)), !, chooseAll(N,L,[R|Seen],Res). chooseAll(,,Res,Res). (e) What is Last Call Optimisation and why is it beneficial? [3 marks] (f ) Rewrite pos to enable Last Call Optimisation. 102 marks] pos([],[]). pos([H|T],[H|R]) :- H >= 0, pos(T,R). pos([H|T],R) :- H < 0, pos(T,R). 9 CST.2016.3.9 8 Software Engineering Discuss the contribution and the relative value of the following aspects of the modern development environment. Illustrate with examples from your group project, or from experience you gained working for a commercial software developer, or both. In each case, would you discard this feature if your employer let you, or insist on retaining it (even covertly) should your employer not value it? Explain your reasons. (a) Dividing a project into short development episodes or sprints. (b) Project progress visualisation tools such as PERT and GANTT charts. (c) Automated regression testing tools. (d) Source code management tools. (e) ScrummingWrite brief notes on functions as values and results in ML, illustrated with the help of the functionals map and exists. What functions can we obtain from these via currying? [6 marks] (b) Consider the function zarg defined below: fun zarg f ([], e) = e | zarg f (x::xs, e) = f(x, zarg f (xs,e)); Show that with the help of this function, it is possible to an expression for the sum of a given list of integers. Then describe what zarg does in general. [4 marks] (c) A polymorphic type of branching trees can be declared as follows. Note that the children of a branch node are given as a list of trees, and that only the leaf nodes carry labels. datatype 'a vtree = Lf of 'a | Br of ('a vtree) list; (i) Write function flat t that converts a given tree t of this type to a list of the labels (without eliminating duplicates). Your function should run in linear time in the size of the tree. [4 marks] (ii) Write function counts x t that counts the number of times that x occurs as a label in t, but without first converting t to a list. Well-known utility functions may be assumed to be available. 3 (TURN OVER) CST.2016.1.4 SECTION B 3 Object-Oriented Programming Java generics allows an ArrayList object to be constrained to use a single specific type (e.g. ArrayList). However, some applications require the ability to store objects of multiple unrelated types. 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] (ii) 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] (c) The solutions in parts (a) and (b) both involve a get() method returning an Object reference. (i) Explain why this is bad practice. [1 mark] (ii) Propose an alternative solution for a constrained array of Integer or LinkedList objects (only) that addresses this issue. [5 marks] 4 CST.2016.1.5 4 Object-Oriented Programming (a) Using example Java code, distinguish between overloading, overriding and shadowing when applied to Java methods.Computer Science Engineering & Technology C++ Programming

How it works

  1. Paste your instructions in the instructions box. You can also attach an instructions file
  2. Select the writer category, deadline, education level and review the instructions 
  3. Make a payment for the order to be assignment to a writer
  4.  Download the paper after the writer uploads it 

Will the writer plagiarize my essay?

You will get a plagiarism-free paper and you can get an originality report upon request.

Is this service safe?

All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 20% with the discount code ESSAYHELP