Reference no: EM133319696
Problem: Explain what is meant by a monad in a programming language, giving the two fundamental operations of a monad along with their types.
Support Details for the question - 5 (TURN OVER) CST.2016.3.6 5 Concepts in Programming Languages (a) [3 marks] (b) Consider the use of a monad for input-output. For the purposes of this question, Use 20 for your itemsEaten dynamic array size (make sure to use a constant for this).
Use 1-71 as your random range for age when creating Goats that the farmer introduces into the trip (use constants). Use age 10 when creating Goats by twin birth.
Case: I suggest using a vector to hold your trip of goats, but you are free to choose your container. (b.ii) (ii) Five flag bits (ci,oi,np,io,i) in each NTFS access-control entry (ACE) manage how it is inherited. Briefly describe the purpose of each bit. [5 marks] (iii) User mike gives his folder project the following access-control list: project AllowAccess mike: full-access (oi,ci) AllowAccess alice: read-execute (ci,np) AllowAccess bob: read-only (oi) It contains one folder and two text files, none of which have any noninherited access-control entries: projectdoc.txt projectsrc projectsrcmain.c For each of these three objects, list all inherited access-control entries, showing in parentheses the inheritance-control flag bits that are set (using the same notation as above). [5 marks] Describe a dynamic programming algorithm for the longest common subsequence problem. b) Find an alignment for the longest common subsequence of "science" and "engineer". Organize your work in a table with appropriately labeled a columns. Show the aligned sequences. Pseudo code for findLCS() appears after the pseudo code for cutRod(). int cutRod( int [] p ) Initialize. Set n to the length of the prices array p. Allocate space for an array r from 0 ton Set r[ o ] to 0 Loop for j from 1 to n inclusive Set q to -o0 for i from 1 toj inclusive if p[i] + r[ j - i] >q Set q to p[i] + r[j - i] set r[j ] to a Return r[n] int [][][] findLCS( sequence X, sequence Y) Initialize. (cHowever, 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. (b (b) What is the state transition diagram for this mystery module? [5 marks] (c) If this module were synthesised to the minimum sum of products form, what would the equations be for next state bits s[0], s[11] and s[12]? [110 marks] 2 CST.21084.1.3 3 Data Structures and Algorithms (a) Describe how the Lempel Ziv text compression algorithm works, illustrating your answer by deriving the sequence of numbers and corresponding bit patterns it would generate when applied to a string starting with the following 24 characters:
Don't forget your destructor. Our first analysis will be to satisfy Mrs. A view of revenue by productline - so we have to produce a pie chart with the Cumulation of revenue by productline from Salesview
Secondly we are going to show Mrs Adebambo a line chart of all sales grouped by productline , each productline will be represented in the chart by a different line and color, remember to use the groups function in the charts setting to ensure you show all lines , the x axis of this line chart should show the actual company names, it is recommend that you join your Salesview with the hive table "Company" to get the Name and only return those CompanyID that are numbered less than 11.