java progrm A software module controls a car park of known…
Question Answered step-by-step java progrm A software module controls a car park of known… java progrmA software module controls a car park of known capacity. Calls to the module’sprocedures enter () and exit() are triggered when cars enter and leave via thebarriers.Give pseudocode for the enter and exit procedures(i) if the module is a monitor [](ii) if the programming language in which the module is written provides onlysemaphores](b) Outline the implementation of(i) semaphores ](ii) monitors Write brief notes on the facilities for lightweight concurrency in Java. You shouldcover the following topics, using code fragments to illustrate your answer:(a) creating a thread(b) mutual exclusion(c) signalling(d]3 Compiler ConstructionWith reference to a strictly-typed block-structured programming language, writebrief notes on the following topics:(a) the allocation and recovery of records stored in a heap(b) the implementation of variables of union type(c) the allocation of arrays with non-manifest bounds(d) the implementation of labels and GOTO commands (a) Compute the global alignment and the best score of the following sequencesCGTGAA, GACTTAC with the following parameters: match score = +5,mismatch score = ?3, gap penalty = ?4. (b) If the sequences have different base composition or length, what parameter valueswould you choose in order to determine multiple alignment of the sequences?Justify your answer. [4 marks](c) Discuss the main features of the Burrows-Wheeler transform (BWT) using thefollowing example: T = GATTACA$. Also explain the reversibility of BWT.[4 marks](d) Discuss the use of clustering in the analysis of gene expression microarray data.[: The parameters for IEEE Double Precision are: ? = 2, p = 53, emin = ?1022,emax = 1023. complete Explain the terms significand, sign bit, exponent, normalised number,denormal number, hidden bit, precision as used in IEEE arithmetic. What valuesdoes the hidden bit have for normalised and denormal numbers? [8 marks]In which order are the significand, sign bit and exponent stored? How is theexponent stored? Deduce how many bits are required to store the Double Precisionexponent. How many bits are required to store a Double Precision h: (a) Explain the concept of Net Present Value (NPV) and include a description ofhow it is calculated. [5 marks](b) You are asked to help prepare a bid, under the Private Finance Initiative (PFI)to develop, install and maintain for 4 years, a patient information system for ahospital. The hospital Trust will pay the bid amount in 5 equal annual paymentsat the beginning of each year. Your development team estimates developmentand installation will cost £1M and maintenance £100k per annum. Which of thefollowing bids: £1500k, £1600k or £1700k should your team submit, assuminga discount rate of 10% per annum? Show your working. [10 marks](c) Draw up a cash flow for this project. How much funding is needed assuming aloan interest rate of 10% per annum?[2/24, 3:02 PM] Jaymoh: (a) Why do modern processors typically exploit multiple cores rather than a singlemultithreaded processor? [5 marks](b) What does support for vector chaining and tailgating allow in a vector processor?[5 marks](c) How might recent advances in die stacking help to improve microprocessorperformance and reduce costs? [5 marks](d) In what ways might parallelism be exploited to reduce the power consumptionof a microprocessor?[: (a) Explain informally the difference between G¨odel’s completeness theorem and hisfirst incompleteness theorem. [8 marks](b) State the meaning of Hoare triples {P} C {Q} in separation logic. [3 marks](c) For each Hoare triple (i), (ii) and (iii) below state whether the triple istrue. Explain your answer and if the triple is true give a proof usingseparation logic. You may assume `P if P is a true separation statement(e.g. ` X 7? 0 ? X 7? ). Such assumed statements should be stated explicitlyand informally justified.(i) {X = 0} [X] :=1 {0 7? 1}(ii) {X.= 0} [X] :=1 {0 7? 1}(iii) {X.= 0 ? X 7? 0} [X] :=1 {0 7? 1} : (a) Clearly explain the Clark-Wilson security policy model and what it tries toachieve, defining technical terms such as CDI, UDI, CW triples, IVP, TP andauditing. [6 marks](b) (i) What is a master key system? What is its purpose? How can we turn anormal pin-tumbler lock into one supporting a master key? [5 marks](ii) Describe in detail the Blaze Privilege Escalation attack on master keysystems. What resources does an attacker need and what can be achieved?Compare the effort required to that of a brute-force attack. [5 marks](c) Discuss the security, privacy and economic aspects of the iPhone’s “App Store”model, as opposed to the traditional desktop software model.[2/24, 3:05 PM] Jaymoh: (a) Clearly explain the Clark-Wilson security policy model and what it tries toachieve, defining technical terms such as CDI, UDI, CW triples, IVP, TP andauditing. [6 marks](b) (i) What is a master key system? What is its purpose? How can we turn anormal pin-tumbler lock into one supporting a master key? [5 marks](ii) Describe in detail the Blaze Privilege Escalation attack on master keysystems. What resources does an attacker need and what can be achieved?Compare the effort required to that of a brute-force attack. [5 marks](c) Discuss the security, privacy and economic aspects of the iPhone’s “App Store”model, as opposed to the traditional desktop software model. (a) Clearly explain the Clark-Wilson security policy model and what it tries toachieve, defining technical terms such as CDI, UDI, CW triples, IVP, TP andauditing. [6 marks](b) (i) What is a master key system? What is its purpose? How can we turn anormal pin-tumbler lock into one supporting a master key? [5 marks](ii) Describe in detail the Blaze Privilege Escalation attack on master keysystems. What resources does an attacker need and what can be achieved?Compare the effort required to that of a brute-force attack. [5 marks](c) Discuss the security, privacy and economic aspects of the iPhone’s “App Store”model, as opposed to the traditional desktop software model.[2/24, 3:06 PM] Jaymoh: Write a program that reads a string and a character from the keyboard. The program should output how many times the character appears in the string [a) A software module controls a car park of known capacity. Calls to the module’sprocedures enter () and exit() are triggered when cars enter and leave via thebarriers.Give pseudocode for the enter and exit procedures(i) if the module is a monitor [8 marks](ii) if the programming language in which the module is written provides onlysemaphores [4 marks](b) Outline the implementation of(i) semaphores [4 marks](ii) monitors : Write brief notes on the facilities for lightweight concurrency in Java. You shouldcover the following topics, using code fragments to illustrate your answer:(a) creating a thread(b) mutual exclusion(c) signalling(d) asynchronous interruption(e) managing priority[4 marks each]3 Compiler ConstructionWith reference to a strictly-typed block-structured programming language, writebrief notes on the following topics:(a) the allocation and recovery of records stored in a heap(b) the implementation of variables of union type(c) the allocation of arrays with non-manifest bounds(d) the implementation of labels and GOTO commands ) Compute the global alignment and the best score of the following sequencesCGTGAA, GACTTAC with the following parameters: match score = +5,mismatch score = ?3, gap penalty = ?4. [4 marks](b) If the sequences have different base composition or length, what parameter valueswould you choose in order to determine multiple alignment of the sequences?Justify your answer. [4 marks](c) Discuss the main features of the Burrows-Wheeler transform (BWT) using thefollowing example: T = GATTACA$. Also explain the reversibility of BWT.[4 marks](d) Discuss the use of clustering in the analysis of gene expression microarray data.The parameters for IEEE Double Precision are: ? = 2, p = 53, emin = ?1022,emax = 1023. Explain the terms significand, sign bit, exponent, normalised number,denormal number, hidden bit, precision as used in IEEE arithmetic. What valuesdoes the hidden bit have for normalised and denormal numbers? [8 marks]In which order are the significand, sign bit and exponent stored? How is theexponent stored? Deduce how many bits are required to store the Double Precisionexponent. How many bits are required to store a Double Precision number?[ : (a) Explain the concept of Net Present Value (NPV) and include a description ofhow it is calculated. [5 marks](b) You are asked to help prepare a bid, under the Private Finance Initiative (PFI)to develop, install and maintain for 4 years, a patient information system for ahospital. The hospital Trust will pay the bid amount in 5 equal annual paymentsat the beginning of each year. Your development team estimates developmentand installation will cost £1M and maintenance £100k per annum. Which of thefollowing bids: £1500k, £1600k or £1700k should your team submit, assuminga discount rate of 10% per annum? Show your working. [10 marks](c) Draw up a cash flow for this project. How much funding is needed assuming aloan interest rate of 10% per annum? (a) Why do modern processors typically exploit multiple cores rather than a singlemultithreaded processor? [5 marks](b) What does support for vector chaining and tailgating allow in a vector processor?[5 marks](c) How might recent advances in die stacking help to improve microprocessorperformance and reduce costs? [5 marks](d) In what ways might parallelism be exploited to reduce the power consumptionof a microprocessor? (a) Explain informally the difference between G¨odel’s completeness theorem and hisfirst incompleteness theorem. [8 marks](b) State the meaning of Hoare triples {P} C {Q} in separation logic. [3 marks](c) For each Hoare triple (i), (ii) and (iii) below state whether the triple istrue. Explain your answer and if the triple is true give a proof usingseparation logic. You may assume `P if P is a true separation statement(e.g. ` X 7? 0 ? X 7? ). Such assumed statements should be stated explicitlyand informally justified.(i) {X = 0} [X] :=1 {0 7? 1}(ii) {X.= 0} [X] :=1 {0 7? 1}(iii) {X.= 0 ? X 7? 0} [X] :=1 {0 7? 1} Write program that receives a positive integer n from the user and then calculates thesum below by using a loop. Your program needs to ask the user to re-enter a differentnumber if the user enters a non-positive one. Display the result. 1 SUM 1 23… n xxn ==+++[|VisualBasic programm You were asked to write program that identifies positive andnegative numbers which the user enters. Then calculate the average of negative andpositive numbers separately. You need to follow the steps below a. Ask the user to enter. [: This question asks you to analyse the design of a familiar website, but applyingfundamental principles of human-computer interaction rather than simply repeatingweb design conventions. Start by choosing the website that you will use for theremainder of the question. This can be any site that has sufficient complexity forthe user to manipulate structured information, and should be a site that you yourselfuse regularly enough to be familiar with its interface. You may assume that theexaminer is familiar with current versions of Facebook, Wikipedia, Gmail, Hermeswebmail, YouTube and Amazon. If you wish to use a site other than one of these,please provide a pictorial sketch that you can refer to in your answer.(a) Name the website that you will refer to in the rest of this question, and explainthe nature of the information structure that the user creates and interacts withwhen using this site. Provide a pictorial sketch if necessary, as described above.[1 mark](b) Describe two aspects of the visual language (marks, symbols, regions, surfaces)used in the design of this site. For each aspect, explain the nature of thecorrespondence between the visual appearance and its meaning or purposewithin the interaction design. [6 marks](c) Describe a typical activity in which the user interacts with the informationstructure presented by the site. You should refer to two different CognitiveDimensions that are particularly salient in this activity, and explain what effecteach of these has on the user’s experience. [6 marks](d) Propose a way in which the visual design of the site might be modified, thatwould have an effect on one of the Cognitive Dimensions described in part (c).Consider any trade-offs that might result. [3 marks](e) Describe how you could carry out an investigation to evaluate the effectspredicted in part (d). [3 marks](f ) How would you classify the method you have described in part (e), using thedistinctions between qualitative/quantitative, empirical/analytic, and summative/formative methods? : The following grammar fragment associates context free syntax rules with lambdacalculus rules for semantic composition:S -> NP VP Vditrans -> givesVP0(NP0) ?y?x?z[give0(z, y, x)]VP -> Vditrans NP PPto Vintrans -> sleeps(Vditrans0(NP0))(PPto0) ?w[sleep0(w)]VP -> Vintrans NP -> SandyVintrans0sPPto -> to NP NP -> KimNP0kNP -> Fidof(a) Show the semantics that the grammar above would assign to:Kim sleepsKim gives Fido to Sandy [2 marks](b) Extend the grammar to also allow:Kim gives Sandy FidoShow the semantics your grammar gives for this sentence. [2 marks](c) Extend the grammar so the following sentences are all given the semanticsreject0(k, f), explaining the reasons for the choices you have made.Kim rejects FidoKim turns Fido downKim turns down Fido[7 marks](d) Most native English speakers accept sentences like (d)(i) below as grammaticalbut find sentences like (d)(ii) ungrammatical. Outline how you would augmentthe grammar you gave in answer to (c) so that (d)(i) was accepted but (d)(ii)was not.(i) Kim turns it down(ii) *Kim turns down it[3 marks](e) What alternative strategy might you use in a large-scale language generationsystem to ensure that (d)(i) was generated in preference to (d)(ii)? In general,what are the advantages and disadvantages of this approach in comparison withconstraining generation by the grammar?[2/24, 3:03 PM] Jaymoh: This question concerns intraprocedural analysis of a flowgraph-style program P whoseinstructions are in three-address form and labelled S1, S2, . . ., with S1 labelling thefirst instruction to be executed. Input parameters to the program are simulated bythe first few instructions of P being of the form x = read(), and the result given bya return instruction.An instruction T is a semantic reaching definition at instruction U if, for someexecution starting at S1, instruction T writes to a variable x which does not sufferan intervening assignment when execution reaches instruction U. We write RD(i)for the set of instructions Sj whose definitions reach instruction Si.(a) By analogy with live variable analysis or available expression analysis, derivedataflow equations for RD and give an algorithm for solving these. Explain anyapproximation you make, carefully justifying the form of this approximation.[Hint: you may find it useful to define gen and kill for instructions.] [8 marks](b) Is your analysis for reaching definitions flow-sensitive or flow-insensitive? Givea one-sentence justification of your answer. [2 marks](c) One use of reaching definitions is for constant propagation: when we know thatreading a variable in an operand in a given instruction will always result in thesame value k, we may replace the operand with k. Carefully explain how we canuse the result of reaching-definitions analysis to perform constant propagation.[Hint: you may find it useful to consider the instruction form z:=x+y.][3 marks](d) Explain how your constant-propagation algorithm would react to the followingflowgraph expressed as C code:int t,r,x;x = read();if (x>91) t=7; else t=6;r = t/2;return r+39;Either explain why your resulting code is optimal, or indicate the source of anyinformation loss which precludes it being optimal. Computer Science Engineering & Technology Java Programming COMPUTER S 167A Share QuestionEmailCopy link Comments (0)


